AzureMapsControl.Components
AzureMapsControl.Components copied to clipboard
What is required to use Azure Maps version 3?
According to this I think it's just:
<link rel="stylesheet" href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.css" type="text/css">
<script src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.js"></script>
Is that it? Any change to:
<link rel="stylesheet" href="https://atlas.microsoft.com/sdk/javascript/drawing/0.1/atlas-drawing.min.css" type="text/css" />
<link rel="stylesheet" href="https://atlas.microsoft.com/sdk/javascript/indoor/0.1/atlas-indoor.min.css" type="text/css" />
<script src="https://atlas.microsoft.com/sdk/javascript/drawing/0.1/atlas-drawing.min.js"></script>
<script src="https://atlas.microsoft.com/sdk/javascript/indoor/0.1/atlas-indoor.js"></script>
That seems to work fine - but I don't know if there's something in the component that will break with this change.
thanks - dave
According to this, do we need to change to:
<link rel="stylesheet" href="https://atlas.microsoft.com/sdk/javascript/drawing/1/atlas-drawing.min.css" type="text/css" />
<script src="https://atlas.microsoft.com/sdk/javascript/drawing/1/atlas-drawing.min.js"></script>
And if I don't allow drawing, do I even need these at all?
And according to this, do we need to change to:
<link rel="stylesheet" href="https://atlas.microsoft.com/sdk/javascript/indoor/0.2/atlas-indoor.min.css" type="text/css"/>
<script src="https://atlas.microsoft.com/sdk/javascript/indoor/0.2/atlas-indoor.min.js"></script>
And again, do we need this at all if we don't use indoor maps?
Version 3 is just the main map library:
<link rel="stylesheet" href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.css" type="text/css">
<script src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.js"></script>
Each module has its own version since they are managed separately. Note that the latest version of each major version of the main map control (v1, v2, v3) work with all the modules. So no need to worry about those versions too much, although using the latest versions of those of course will have the most improvements/bug fixes.
For background, here are the main breaking changes that occurred between the major versions, that justified there being a major version number:
- V1 -> V0 was live for about 3 months and wasn't well designed. I joined the team just as this released, so couldn't stop that version going out. V1 maintained the v0 code for backwards compatibility to get early adopters time to upgrade. The new main API interface of V1 is 100% in v3, with additional features/bug fixes/improvements added.
- V2 -> Removed the V0 API interface. We also moved from
mapbox-gl-jsto themaplibrefork of the project (Mapbox had changed their license on their open-source project to make it basically proprietary , so the community forked the last truly open-source version of it). I also believe this was when we introduced a second authentication method (managed identities/Microsoft Entra ID) which meant theauthOptionsproperty was added to the map (before you simply set the subscription key on a property of theatlasnamespace, this is still there and can be used as alternative but not recommended). - V3 -> The underlying
maplibrelibrary was upgraded to the latest major version which had a lot of changes to it that required a lot of updates in the map control. I believe the documented API interface was maintained, but anyone who had code overriding CSS classes, or who were directly accessing the underlying maplibre map instance for additional capabilities likely ended up with breaking code.
A changelog of the minor versions from V2 on is available here: https://learn.microsoft.com/en-us/azure/azure-maps/release-notes-map-control
I'm using version 3 with no problems (so far). But I leave it to someone who knows this code well to decide if they want to change the documentation and samples to use the latest versions.
And leaving this open as I think it all should be updated.