none
Bing V8 - Getting Error while loading page RRS feed

  • Question

  • Hi,

    We are getting Javascript error while loading V8 version of the mapcontrol. From the console we could get the error as "Unable to get property 'prototype' of undefined or null reference".

    As per the suggestion in the blog https://social.msdn.microsoft.com/Forums/en-US/24a16480-7513-4743-918f-d0132b1246ba/bing-map-v8-not-loading-in-webform?forum=bingmapsajax we tried the async defer with Callback but now we are getting the error.

    Uncaught ReferenceError: Microsoft is not defined at GetMap 

    <script type="text/javascript" src="https://www.bing.com/api/maps/mapcontrol?callback=GetMap" async defer></script>

     <script type="text/javascript">
            var map;

                

    function GetMap() {

                map = new Microsoft.Maps.Map(document.getElementById('<%=Map.ClientID%>'), {
                    credentials: BingKey
                });
            }

    Is it a known error or am I missing something?



    Friday, March 17, 2017 8:25 AM

Answers

  • Not able to reproduce this issue. Only thing I can think of is that the map control is cached and is trying to call the GetMap function before the page has loaded it. Try moving the map script URL lower in your page after the script tag you are loading the map in and possibly at the bottom of the body of the page and see if that makes a difference or not.

    [Blog] [twitter] [LinkedIn]

    Friday, March 17, 2017 2:54 PM