# AzureMapsControl.Components **Repository Path**: mirrors_lextm/AzureMapsControl.Components ## Basic Information - **Project Name**: AzureMapsControl.Components - **Description**: Razor Components for azure-maps-control - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: develop - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-07-16 - **Last Updated**: 2026-02-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README   [](https://github.com/arnaudleclerc/AzureMapsControl.Components/actions/workflows/build.yml) [](https://github.com/arnaudleclerc/AzureMapsControl.Components/actions/workflows/unit-tests.yml) [](https://github.com/arnaudleclerc/AzureMapsControl.Components/actions/workflows/release.yml) [](https://codecov.io/gh/arnaudleclerc/AzureMapsControl.Components) [](https://join.slack.com/t/azuremapscontrolcomp/shared_invite/zt-oyoclzro-ZoFakjPLD8Y~nlxO49ybjg) This library allows you to use `Azure Maps` inside your razor application.  ## Install the Nuget Package This library is available on [Nuget](https://www.nuget.org/packages/AzureMapsControl.Components/) as `AzureMapsControl.Components`. ## Setup ### Add the css and scripts You will need to add the atlas script and css files as well as the script generated by the library on your application. ``` ``` ``` ``` Or use the minimized version : ``` ``` ### Register the Components You will need to pass the authentication information of your `AzureMaps` instance to the library. `SubscriptionKey`, `Aad` and `Anonymous` authentication are supported. You will need to call the `AddAzureMapsControl` method on your services. You can authenticate using a `subscription key` : ``` // This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); services.AddServerSideBlazor(); services.AddAzureMapsControl(configuration => configuration.SubscriptionKey = "Your Subscription Key"); } ``` Or using `Azure Active Directory`: ``` public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); services.AddServerSideBlazor(options => options.DetailedErrors = true); services.AddAzureMapsControl(configuration => { configuration.AadAppId = "Your Aad App Id"; configuration.AadTenant = "Your Aad Tenant"; configuration.ClientId = "Your Client Id"; }); } ``` The `Anonymous` authentication requires only a `ClientId`: ``` public void ConfigureServices(IServiceCollection services) { services.AddRazorPages(); services.AddServerSideBlazor(options => options.DetailedErrors = true); services.AddAzureMapsControl(configuration => configuration.ClientId = Configuration["AzureMaps:ClientId"]) } ``` It also needs to fetch the token to send to the requests of the atlas library. For that, you have to override the `azureMapsControl.Extensions.getTokenCallback` method on your application after referencing `azure-maps-control.min.js` and resolve the token in it. For example : ``` @page "/" @namespace AzureMapsControl.Sample.Pages @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @{ Layout = null; }