2.10.0 Change Notes
Tile compression
IModelHostConfiguration.compressCachedTiles specifies whether tiles uploaded to blob storage should be compressed using gzip. Previously, it defaulted to false
if omitted. The default has now been switched to true
. Compressing tiles conserves bandwidth; the tiles are transparently and efficiently decompressed by the browser.
Changes to display style excluded elements
DisplayStyleSettings.excludedElements
allows a display style to specify a set of elements that should not be drawn. Previously, this set was always persisted to the database as an array of element Ids, and represented in JSON and in memory as a Set<string>
. However, element Ids tend to be long strings (at least 13 characters), and sets of excluded elements can occasionally grow quite large. To reduce the amount of data associated with these sets:
- They are now always persisted to the database as a CompressedId64Set.
- The type of DisplayStyleSettingsProps.excludedElements has changed from
Id64Array
toId64Array | CompressedId64Set
. DisplayStyleSettings.excludedElements
- aSet<string>
- has been deprecated in favor of DisplayStyleSettings.excludedElementIds - an OrderedId64Iterable.- IModelDb.Views.getViewStateData and ElementLoadProps allow the caller to specify whether the Ids should be returned in compressed (string) form or as an uncompressed array; by default, they are uncompressed.
- IModelConnection.Views.load will always use the compressed representation of the Ids.
To adjust code that uses DisplayStyleSettings.excludedElements
, given settings: DisplayStyleSettings
:
settings.excludedElements.add(id); // Replace this...
settings.addExcludedElements(id); // ...with this.
settings.excludedElements.delete(id); // Replace this...
settings.dropExcludedElements(id); // ...with this.
settings.excludedElements.clear(); // Replace this...
settings.clearExcludedElements(); // ...with this.
for (const id of settings.excludedElements) { } // Replace this...
for (const id of settings.excludedElementIds) { } // ...with this.
Note that DisplayStyleSettings.addExcludedElements and DisplayStyleSettings.dropExcludedElements can accept any number of Ids. If you have multiple Ids, prefer to pass them all at once rather than one at a time - it is more efficient.
Breaking API changes
The union type Matrix3dProps inadvertently included Matrix3d. "Props" types are wire formats and so must be pure JavaScript primitives. To fix compilation errors where you are using
Matrix3d
where aMatrix3dProps
is expected, simply call Matrix3d.toJSON on your Matrix3d object. Also, since TransformProps includes Matrix3dProps, you may need to call Transform.toJSON on your Transform objects some places too.The type of Texture.data has been corrected from
string
toUint8Array
to match the type in the BIS schema. If you get compilation errors, simply remove calls toBuffer.from(texture.data, "base64")
for read, andtexture.data.toString("base64")
if you create texture objects.
Updated version of Electron
Updated version of electron used from 8.2.1 to 10.1.3. Note that Electron is specified as a peer dependency in the iModel.js stack - so it's recommended but not mandatory that applications migrate to this electron version.
Globe location tool fixes
The globe location tools now will properly use GCS reprojection when navigating. Previously, navigating to certain cartographic locations within the iModel extents could be slightly inaccurate.
The tools affected are:
The ViewGlobeLocationTool has been further improved to navigate better across long distances when using plane mode.
There is now a method called lookAtGlobalLocationFromGcs
on ViewState3d. This method behaves exactly like lookAtGlobalLocation
except that is async and uses the GCS to reproject the location.
ViewState3d also has GCS versions of these methods:
rootToCartographicFromGcs
behaves likerootToCartographic
except it is async and uses the GCS to reproject the location.cartographicToRootFromGcs
behaves likecartographicToRoot
except it is async and uses the GCS to reproject the location.
Last Updated: 15 May, 2024