How to retrieve all layer IDs and source-layers in Azure Maps road_shaded_relief?

Florent Lavergne (iMetaverse LLC) 60 Reputation points Microsoft External Staff

Hi,

I’m customizing the Azure Maps Web SDK using the road_shaded_relief basemap and need a stable reference of all style layers and their source-layer names.

map.map.getStyle().layers returns the layers currently loaded in the browser, but I’m looking for something official and documented.

Is there:

A published style JSON for this basemap?

Documentation listing all layer IDs?

Documentation of the underlying vector tile schema?

If layer IDs are not considered stable, what is the recommended way to reliably target specific feature classes such as country boundaries or major roads?

Thank you.

0 comments No comments

Sign in to comment

Answer accepted by question author

rbrundritt 21,711 Reputation points Volunteer Moderator

The Azure Maps team hasn't publicly documented the layers used within the styles. These styles change fairly regularly on the Microsoft side, and I believe they don't document these things so that they can update it seamlessly without having to worry about supporting different versions of the styles.

  1. rbrundritt 21,711 Reputation points Volunteer Moderator

    That said, if you want to do some custom styling or use the vector tiles elsewhere and willing to take the risk of the styles changing without notice, then there are a few options to see the styles. The easiest is to watch the network traffic when the map loads or when you change map styles. For example, this URL gets the style JSON for the light gray scale style "https://atlas.microsoft.com/styling/styles/grayscale_light?styleVersion=2023-01-01&mcv=372&api-version=2.0"

    Another option is to use the MapLibre API that's under the hood of the Azure Maps Web SDK like map.map.getStyle() You can also loop through all the layers and sources in the map using some of the functions under map.map

  2. Florent Lavergne (iMetaverse LLC) 60 Reputation points Microsoft External Staff

    Thank you for these useful tips!


Sign in to comment

1 additional answer

  1. AI answer

    Azure Maps does not publish the full style JSON, layer ID list, or vector tile schema for the built‑in basemap styles such as road_shaded_relief.

    From the available documentation:

    • road_shaded_relief is described as “an Azure Maps main style completed with contours of the Earth” and is exposed only as a named built‑in style that can be selected in supported APIs (for example, Web SDK map control and Get Map Tile).
    • The documentation for supported map styles focuses on the style names (such as road_shaded_relief, grayscale_dark, grayscale_light, night, satellite, satellite_with_roads) and their applicability to APIs, not on internal layer IDs or vector tile layer names.
    • There is no reference in the provided material to a public style JSON, a catalog of layer IDs, or a documented vector tile schema for these basemaps.

    Given this, there is no official, documented way in the referenced content to:

    • Download or inspect a canonical style JSON for road_shaded_relief.
    • Rely on a published list of style layer IDs.
    • Use a documented vector tile schema for targeting specific feature classes.

    The referenced content also does not describe a recommended pattern for programmatically and stably targeting specific feature classes (such as country boundaries or major roads) within the built‑in basemap styles.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.
Sign in to answer

Your answer