arnaudleclerc/AzureMapsControl.Components

Map Will Not load with Subscription Key

Closed this issue · 1 comments

When attempting to use the subscription key for authentication the amp will not load. in the console the following error is given.
image

A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Follow steps in readme
  2. Use services.AddAzureMapsControl(configuration => configuration.SubscriptionKey = "Your Subscription Key");
    Add map to index
@using AzureMapsControl.Components.Map
<AzureMap Id="map"
          CameraOptions="new CameraOptions { Center= new AzureMapsControl.Components.Atlas.Position(11.581990, 48.143534), Zoom= 10 }"
          StyleOptions="StyleOptions"/>

@code {
    public StyleOptions StyleOptions = new StyleOptions
    {
        Style = MapStyle.Satellite,
        ShowLogo = false,
        ShowFeedbackLink = false
    };
}

Expected behavior
Map to show up

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Win 11
  • Browser Edge Chrome
  • Blazor Web assembly

Additional context
I may be doing something wrong with the getTokenCallback i was not sure if i needed to set that up for the subscription key to work.

image

Was able to fix this issue myself, closing as it is not an application issue