none
Bing Map V8 control error changing map type from streetside to road RRS feed

  • Question

  • I'm using the Bing Map V8 control. I can change my map type from road to streetside but not from streetside to road or aerial. Why does this fail?

    I need to use a separate input button to change the map type on my application based on some business logic and have always switched between aerial and road this way.

    If you paste the following javaScript into the javascript panel of the interactive examples site I think you will see what is happening, https://www.bing.com/api/maps/sdkrelease/mapcontrol/isdk#streetsideFailoverToRoad+JS.

    It is suppose to change the map type after waiting two seconds but only works in one direction road to streetside.

    This code fails if I start in a map type of streetside and try to change to road it fails.

    var map = new Microsoft.Maps.Map(document.getElementById('myMap'), { credentials: 'Your Bing Maps Key', mapTypeId: Microsoft.Maps.MapTypeId.streetside, center: new Microsoft.Maps.Location(47.608, -122.335), streetsideOptions: {showExitButton: false } }); setTimeout(changeToRoad, 2000 /*ms*/); function changeToRoad(){ map.setView({ mapTypeId: Microsoft.Maps.MapTypeId.road }); // this line fails }

    This code works, the only difference is that it starts with a map type of road and changes to streetside.

    var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
        credentials: 'Your Bing Maps Key',
        mapTypeId: Microsoft.Maps.MapTypeId.road,
        center: new Microsoft.Maps.Location(47.608, -122.335),
        streetsideOptions: {showExitButton: false }
    });
    
    setTimeout(changeToRoad, 2000 /*ms*/);
    
    function changeToRoad(){
    	map.setView({ mapTypeId: Microsoft.Maps.MapTypeId.streetside }); // this line works
    }


    • Edited by jmt116 Thursday, June 1, 2017 11:02 PM typos
    Thursday, June 1, 2017 10:56 PM

Answers

  • Have you tried the experimental branch (add &branch=experimental to the map script URL). This issue looks to already be fixed there. The fixes in the experimental branch will be rolled into the main release branch in about a week and a half. 

    [Blog] [twitter] [LinkedIn]

    Friday, June 2, 2017 4:57 AM

All replies

  • Have you tried the experimental branch (add &branch=experimental to the map script URL). This issue looks to already be fixed there. The fixes in the experimental branch will be rolled into the main release branch in about a week and a half. 

    [Blog] [twitter] [LinkedIn]

    Friday, June 2, 2017 4:57 AM
  • Experimental still failed, any ideas of when this might be fixed?
    Monday, June 5, 2017 2:03 PM
  • Not yet. I sent an email to the team on Friday asking them to look into this to see if it was related to a recent fix they just checked in (may be in the experimental branch already or will be today or tomorrow). Will let you know if I hear anything. 

    [Blog] [twitter] [LinkedIn]

    Monday, June 5, 2017 4:02 PM