none
BIng map v8 & IE11 does not work straight forward RRS feed

  • Question

  • I am trying to build bing map v8 after querying a SharePoint list for the address. This address needs to be passed to Search to get search manager and then query the address. Based on the results, I will create push pin and info box. I used a sample from git repo to create a simple map. it worked as expected. the problem started after I add real business case.

    On list items query success, I have to add deffered/resolve object to make sure SP execute query works sync way before I call the map objects.

    Now, when I pass the address to create search manager object and query address, it has a recursive call until it loads the search module. This scenario was not working previously when I had lazy loaded JS and now also when I have single JS file.

    to overcome this, I have to include REST based search API. API works fine. I get the JSON result back. Now I can't find any sample which can help me to create push pin set map view based on the push pin. 

    Errors/Issues - 

    1. When I can search module load and get search manager object, somewhere cached files does not respond back. This works in Edge/Chrome but not in IE11.

    2. Now in REST API, I get coordinates of location (Lang & Lat). I can call push pin to get added on map using this. But this does not create any push pin on map

    3. When I try to get pushpin.getLocation(), it throws error invlida Lat/Long value.

    I am happy to talk but seems there is a bing map v8 API limitations with IE11 when you have multiple async call on JS. I event tried lazy loading of map and trying lazy loading of search components.

    I hope Ricky you will reply to this. I would be happy to provide you more detailed info and upload script.


    Thanks, Ashish | Please mark a post helpful/answer if it is helpful or answer your query.

    Monday, October 9, 2017 1:18 PM

Answers

  • 1. Not sure about this. If you are not using the callback function on the map script, and the map script tag isn't the last thing in your page, this is likely a timing issue. IE11 is slower and thus timings are different from Edge. So although it my work in Edge for you, someone on a slower network may run into the same issue there. Your implementation sounds a bit odd. Can you provide more details on how you are loading the map API and using the search module.

    2. Using the REST services is fairly easy. An example of using it in JavaScript can be found here: http://bingmapsv8samples.azurewebsites.net/#RestServices_JSONP To create a pushpin, you can do the following: 

    var pin = new Microsoft.Maps.Puspin(new Microsoft.Maps.Location(results[0].point.coordinates[0], results[0].point.coordinates[1]));
    map.entities.push(pin);

    3. Make sure you aren't reversing the latitude and longitude values when creating a location object and passing it into a pushpin. If you do, in some cases the values will be invalid and throw the error you are seeing, while in all other cases the pushpin will likely not appear in the expected location.


    [Blog] [twitter] [LinkedIn]

    Monday, October 9, 2017 5:48 PM