Hi, you can fetch the feature that's rendered on the map, then overlay a new colored layer on top to show zones.
- Fetch the data embedded in the current view of the map.
(ex) This will fetch a list of "Indoor zone" layer features.
const features = map.layers.getRenderedShapes().filter(f => f.layer['source-layer'] === "Indoor zone");- Add a polygon layer to the map.
(ex) This will append the first Indoor zone feature to the data source.
const dataSource = new atlas.source.DataSource();
map.sources.add(dataSource); // Add the zone feature to the data source
dataSource.add(features[0]); // assumes features array is not empty // Create and add a polygon layer to render the polygon to the map, below the label layer
map.layers.add(new atlas.layer.PolygonLayer(dataSource, null,{
fillColor: 'red',
fillOpacity: 0.7
}), 'labels'); - Add a polygon layer to the map.
If rendering needs to be dynamic as map camera is moved around, you may use an event handler for the map.
Also to note, there are community supported Angular JS and React JS modules; however, we do not directly maintain nor support them.