How to use Terra maps (MapTile.GetTerraTile and layer=terra) in azure map.

Smit Khanpara 0 Reputation points
2023-10-19T12:37:47.1133333+00:00

In React
How to add Terra maps (MapTile.GetTerraTile and layer=terra) in azure map.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
805 questions
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 20,181 Reputation points Microsoft Employee
    2023-10-19T13:37:17.1333333+00:00

    I haven't seen GetTerraTile in any docs for any Azure Maps API or SDK. You mention React, so I would assume you are using the Azure Maps React library here: https://github.com/Azure/react-azure-maps Looking through the source code, I still don't any such method name.

    In the Web SDK of Azure Maps, the Terra map tiles are a part of the road_shaded_relief map style.

    Assuming you are using that react library and you want to see the terra layer, here is how you can do that based on this example: https://github.com/Azure/react-azure-maps-playground/blob/master/src/examples/Options/ChangeOptions.tsx

      const option: IAzureMapOptions = useMemo(() => {
        return {
          authOptions: {
            authType: AuthenticationType.subscriptionKey,
            subscriptionKey: key,
          },
          center: [-100.01, 45.01],
          zoom: 10,
          view: 'Auto',
          style: 'road_shaded_relief'
        };
      }, []);
    
    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.