Lazy Load the Map
This sample shows how to delay the loading of the map SDK until it is needed. This is useful if your map is hidden and not displayed by default (i.e. hosted in a tab). By waiting until the user actually needs the map before loading it, you can reduce the amount of resources the browser uses initially and speed up your page loading while also reducing the number of transactions that are generated by your application and thus reducing your costs. Additionally, this method can also be used to detect if there is an issue accessing the Azure Maps Web SDK (i.e. no internet connection, or user is in an unsupported region such as China).