none
Bing map load issue on Ipad RRS feed

  • Question

  • Hi ,

    We are using Dynamics CRM app and in that we have added the HTML page to load the bing map to show the pushpin. But in  ipad it took around 2 mins to load map. When we access the same on web browser it load within 20 secs.

    We have used following code to load map.

    function loadMap() {
        var functionName = "loadMap ";
        try {

            var mapScriptUrl = 'https://www.bing.com/api/maps/mapcontrol?callback=getMap';
            var script = document.createElement("script");
            script.setAttribute('defer', '');
            script.setAttribute('async', '');
            script.setAttribute("type", "text/javascript");
            script.setAttribute("src", mapScriptUrl);
            document.body.appendChild(script);

        } catch (e) {
            alert(functionName + " " + e.message);
        }
    }

    function getMap()
    {
     var map = new Microsoft.Maps.Map(document.querySelector("#mapcontrol"), {
                            credentials: _credentials
                        });
    }

    Can anyone have solution to resolve this issue.

    Thanks!

            

    Balasaheb

    Wednesday, April 18, 2018 3:39 PM

Answers

  • Can you try loading the map asynchronously rather than a lazy load and see if this makes a difference? Also are there other scripts you are running?
    Friday, April 20, 2018 1:03 PM
    Moderator

All replies

  • Using liteMode will disable the vector labels and reverts back to rendering map labels on the map tile images on the server, just like V7 map control. This is a good option to enable when rendering large data sets. It is also recommended to use this when using the map on a less powerful device, or when accessing the map from a location that is known to have slow network speeds, in fact in those cases map can try to automatically use liteMode to improve the overall performance. It is completely safe to use it, as it’s officially supported feature.

    Can you try adding this in your application and seeing if it makes a difference?

    function getMap()
    {
     var map = new Microsoft.Maps.Map(document.querySelector("#mapcontrol"), {
                            credentials: _credentials,
                            liteMode: true
    
                        });
    }

    That's all you'll need to do to test. Let me know how it goes.

    Thursday, April 19, 2018 5:39 PM
    Moderator
  • Hi David,

    Thanks for your response. We tried litemode but it did not work because we used loadMap() function to load map and we initialize map at getMap() function. At getMap() function it comes after 2 mins. Our guss is that it took time to load bing maps script. Is there any way to load bing map quicker.

    One more thing we are using angularjs to load bing map.

    Thanks!

          



    Balasaheb

    Friday, April 20, 2018 9:25 AM
  • Can you try loading the map asynchronously rather than a lazy load and see if this makes a difference? Also are there other scripts you are running?
    Friday, April 20, 2018 1:03 PM
    Moderator