That legend control was created for version 2 so it should work. Note that it is not a built-in part of the Azure Maps control, but an open-source module you can host and load into your app. Be sure to download the source files from the dist
folder from here: https://github.com/Azure-Samples/azure-maps-layer-legend Then host these as js/css files in your app, load them into your page after the script tag for the Azure Maps control, and it will add itself to the atlas
namespace.
Use legends in azure map contol older version
Satyam Chauhan
547
Reputation points
Hi,
I am using azure maps control version - 2.1.8 and I want to show a customized legend for my map. I have seen the example provided in azure map samples - https://samples.azuremaps.com/?search=legend&sample= which uses - new atlas.control.LegendControl, but on using it, I get the following error - Property 'LegendControl' does not exist on type 'typeof control'.
Please share some examples how can I use this in older version of azure-map-control package. Due to restrictions I cannot upgrade the package version.
1 answer
Sort by: Most helpful
-
rbrundritt 18,591 Reputation points Microsoft Employee
2024-05-28T15:32:41.0933333+00:00