This question is for the package AzureMapsControl.Components (which is a lightweight wrapper over Azure Maps. This package has the class Feature that is sometimes used instead of Shape? I don't see any equivalent to Feature in Azure Maps - so what is this exactly? When would you use it instead of Shape?
The main difference I see is Feature has a BoundingBox, which is another class with no matching class I can find in Azure Maps.
Azure Maps does have Features and Shapes. Azure Maps wraps MapLibre (based on an open-source version of Mapbox). It's a powerful map rendering library that leverages open data formats (primarily GeoJSON), but the API itself is pretty low level (has the tools you need, but requires a lot more work for common scenarios). In particular, it seems like the original scenario Mapbox targeted was for users to load all the data they needed on map load and not to update it afterwards (excluding tile data sets). There is tools to update the data in the map, but it requires reloading all of the data each time there is a data update and it can be a lot of work to get this managed correctly in larger apps. Azure Maps focused more on enabling common developer scenarios and wrapped these lower-level tools accordingly to make it easier to accomplish these tasks. A feature in Azure Maps is a raw GeoJSON object and has no methods or bindings on it. If you add a feature to the map and then modify a property on the feature, the map does not update. Azure Maps added the Shape class that wraps a GeoJSON feature and enables binding. If you change any property on the shape, the map/data source will update accordingly. There are also built-in optimizations to throttle the updates when a user updates many shapes within a loop. A DataSource can take in combination feature or shape objects. The DataSource will wrap all features it receives as a shape and you can get these from the data source if you want to make updates. Outside of the DataSource class Azure Maps tries to leverage GeoJSON for most other things, such as bounding boxes which represent an area but are not a shape (these generally are not rendered in GIS platforms, but Azure Maps does have a helper method to convert a bounding box into a polygon if needed (atlas.math.boundingBoxToPolygon
). The maps camera uses GeoJSON positions and bounding box objects.
Some important notes: