azureleafletazure-maps

Azure Maps hybrid tileset needs to be combined with another layer?


Straight to the point - how are you supposed to do a "hybrid" satellite/road map using Azure Maps tiles?

I am using Azure Maps tiles (https://learn.microsoft.com/en-us/rest/api/maps/render/get-map-tile?view=rest-maps-2024-04-01&tabs=HTTP). And example usage of different TileSetIDs can be found here (https://samples.azuremaps.com/third-party-map-controls/azure-maps-leaflet-options) but the documented list of available tilesets are here: https://learn.microsoft.com/en-us/rest/api/maps/render/get-map-tile?view=rest-maps-2024-04-01&tabs=HTTP#tilesetid

I am using both Leaflet and direct calls to the Get Map Tiles API, but the results are the same. I want to have a standard "hybrid" map that has roads overlayed on top of the aerial images. The available hybrid tileset, microsoft.base.hybrid.road, appears to be the roads over a transparent background. This is also observed in the sample site above. In Leaflet I can add multiple tile layers, i.e. first draw the microsoft.imagery tileset and then draw the hybrid tileset on top of it.

But is that really how it's supposed to work? I'm running into an issue in another application that doesn't use Leaflet and instead wants the GET API call for a specific single basemap. Does Azure Maps not provide a standalone standard hybrid tileset?


Solution

  • Yes, that is currently how you can add a roads layer above satellite imagery when using Azure Maps in Leaflet. This example has a layer group that brings both together on the map: https://github.com/Azure-Samples/azure-maps-leaflet/blob/main/examples/Show%20Azure%20Maps%20in%20Leaflet%20layer%20control.html