We currently use Azure Maps for our web based solution and everything works great. We have many points on the map (as Shapes) that relate to assets for our customers.
I have been tasked with adding additional functionality, such that as well as displaying assets on the map, we would also like to display customer depots (probably about 3 in total), each with a radius of approx 1km.
I have implemented 2 shape to represent a customer depots, but when I zoom in on the map to street-level, the circle stays where it should, but I get two or three or more random icons appear. On zooming out, all is good.
I've changed the code around to try Shapes and Features, and both give the same result. The only way I can temporarily resolve it, is to limit the layers visibility, when zooming in (which is not great from a user-experience).
Any suggestions for a better way, that works when fully zoomed in?Screenshot 2023-01-11 14.49.42.png
p1 = new atlas.data.Point([0.96015, 51.85546]);
point = new atlas.Shape(p1, null, {
subType: "Circle",
radius: 1000,
icon: 'red',
});
//Load all the custom image icons into the map resources.
Promise.all(iconPromises).then(function () {
var symbolLayer_assets = new atlas.layer.SymbolLayer(datasource, null, {
visible: true,
iconOptions: {
allowOverlap: true,
//Use a match expression to select the image icon based on the property value of the data point.
image: [
'case',
//Verify the feature has a property property.
['has', 'icon'],
//If it does, use it to determine which icon to use.
[
'match',
['get', 'icon'],
//For each property value, specify the icon name to use.
'25', 'icon-25',
'50', 'icon-50',
'51', 'icon-51',
'61', 'icon-61',
'68', 'icon-68',
'82', 'icon-82',
'black', 'marker-black',
'red', 'marker-red',
'none', 'none',
//Default fallback icon.
'marker-red'
],
//Default fallback icon.
'marker-red'
]
}
});
map.layers.add(symbolLayer_assets);
});
//Create a polygon layer to render the filled in area of the circle polygon, and add it to the map.
map.layers.add(new atlas.layer.PolygonLayer(datasource, null, {
fillColor: 'yellow',
fillOpacity: 0.4,
maxZoom: 24,
}));