none
Bing Maps v8 - Blank Page RRS feed

  • Question

  • Hi,

    As of yesterday, my v8 maps display just a blank page.  There are no error reports on the console other than the usual plethora of Unknown property/Error in parsing value/Declaration dropped warnings, although these at least confirm that the v8 control has started to load.  Has there been an update that might break code last tested a few weeks ago?

    P.S. Same behaviour in Firefox, Chrome, IE 11, Edge.

    JPL



    • Edited by JPL5780 Monday, June 20, 2016 2:23 PM
    Monday, June 20, 2016 1:59 PM

Answers

  • I've been able to reproduce the issue and have an idea of what is causing it. The OS map tiles require a Bing Maps key to access them, otherwise they return a 401 error. Rather than using your Bing Maps key, V8 tries to use a session key from the map so that you don't get charged for the individual tiles. However, due to the asynchronous loading of the V8 map control and a feature which displays a splash screen type map image while the map is loading, the session key isn't available right when the map is being loading, and thus the tile requests fail initially. If you try moving the map new tiles will be loaded and work. The team is looking at a couple of solutions to resolve this. I don't have a timeline for this at the moment as it's not a high priority feature (few paying customers use OS maps). One solution you can implement as a workaround is to load the map without the map type id and in the next line of code after the map use the setView function of the map and change the map type.

    [Blog] [twitter] [LinkedIn]

    • Marked as answer by JPL5780 Thursday, June 23, 2016 12:25 PM
    Wednesday, June 22, 2016 9:04 PM
  • Update. This is now working correctly in the experimental branch. A fix was pushed out last week just before the weekend.

    [Blog] [twitter] [LinkedIn]

    Wednesday, July 6, 2016 11:58 PM

All replies

  • The experimental branch was merged with the release branch in preparation with bring V8 out of preview. We have been doing a lot of testing and haven't seen the issue you are reporting. Can you provide a simple code sample that reproduces the issue you are seeing?

    [Blog] [twitter] [LinkedIn]

    Monday, June 20, 2016 5:31 PM
  • Hi,

    I was focussing on the JavaScript as I was in the middle of some JS changes, but I added Net logging to the console output and this showed what is happening.  The problem affects the OS Map view only, and it looks like a permissions issue with the map tiles:

    23:38:32.267 GET https://t3.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/03131310332003 [HTTP/1.1 401 Unauthorized 56ms]
    23:38:32.267 GET https://t1.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/03131310332021 [HTTP/1.1 401 Unauthorized 60ms]
    23:38:32.268 GET https://t2.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/03131310332012 [HTTP/1.1 401 Unauthorized 58ms]
    ...

    Example Map

    JPL



    • Edited by JPL5780 Monday, June 20, 2016 10:52 PM
    Monday, June 20, 2016 10:48 PM
  • Try removing the mkt parameter from the map script URL. It is currently not supported and not needed, but may cause issues. The V8 map control automatically detects the users culture settings from their browsers.

    [Blog] [twitter] [LinkedIn]

    Tuesday, June 21, 2016 1:10 AM
  • Hi,

    I think &mkt=en-GB was required with the v7 API in order to enable the OS Map view, and so in the absence of any info. to the contrary I carried on using it with v8.

    Removing &mkt=en-GB has no effect - the 401 errors remain.

    JPL

    Tuesday, June 21, 2016 11:23 AM
  • I'll have the team look into this to see if they can reproduce and fix the issue.

    [Blog] [twitter] [LinkedIn]

    Tuesday, June 21, 2016 12:50 PM
  • Hi,

    Thanks for your help.

    P.S. Changing &sty=s to &sty=r at the end of the Example Map link in the post above changes

      mapTypeId: Microsoft.Maps.MapTypeId.ordnanceSurvey

    to

      mapTypeId: Microsoft.Maps.MapTypeId.road

    in the map options and results in a working map.

    JPL

    Tuesday, June 21, 2016 1:14 PM
  • Hi,

    Even stranger - after opening the map page with Road view selected (&sty=r), the view can be successfully switched to OS Map via the drop-down at the top right of the map.  This time the tiles load OK, albeit slowly (most of the the simpler Road view tiles load in 15-30ms):

    09:24:21.060 GET https://t3.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/03131310332003 [HTTP/1.1 200 OK 408ms]
    09:24:21.061 GET https://t1.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/03131310332021 [HTTP/1.1 200 OK 428ms]
    09:24:21.062 GET https://t2.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/03131310332012 [HTTP/1.1 200 OK 419ms]
    ...

    JPL

    Wednesday, June 22, 2016 8:36 AM
  • I've been able to reproduce the issue and have an idea of what is causing it. The OS map tiles require a Bing Maps key to access them, otherwise they return a 401 error. Rather than using your Bing Maps key, V8 tries to use a session key from the map so that you don't get charged for the individual tiles. However, due to the asynchronous loading of the V8 map control and a feature which displays a splash screen type map image while the map is loading, the session key isn't available right when the map is being loading, and thus the tile requests fail initially. If you try moving the map new tiles will be loaded and work. The team is looking at a couple of solutions to resolve this. I don't have a timeline for this at the moment as it's not a high priority feature (few paying customers use OS maps). One solution you can implement as a workaround is to load the map without the map type id and in the next line of code after the map use the setView function of the map and change the map type.

    [Blog] [twitter] [LinkedIn]

    • Marked as answer by JPL5780 Thursday, June 23, 2016 12:25 PM
    Wednesday, June 22, 2016 9:04 PM
  • Hi,

    Thanks very much for the detailed reply.  It is quite an interesting problem.

    I don't see a splash screen type map, and it is not possible to move the map as there is no map to move. However, the idea of loading a Road map and then immediately changing the view sounds like a straightforward workaround. I'll have a look at that tomorrow.

    In the UK anyone who used a map before electronic mapping had been invented considers OS Maps to be the jewel in the mapping crown, and it is wonderful that Bing supports them, but I appreciate it is not a commercial priority for you.

    JPL

    Wednesday, June 22, 2016 10:33 PM
  • You don't see the splash screen map as the tiles needed for it when set to OS tiles are getting 401 errors.

    The map is there, I've seen it on your site. After a few seconds double click the page where the map should be and you will see some tiles appear.

    I'm well aware of the history around OS maps and have met with them regularly. In the consumer space, primarily when it comes to outdoor activities, OS maps is very popular, however, the overwhelming majority of the companies that license Bing Maps are not in the consumer space, and many of those who are don't see much usage of the OS map layer. I have the raw numbers and even ran a survey with the customers. I won't go into the details, but the deciding factor for adding OS maps in V8 was due to a lot of feedback on our consumer website (bing.com/maps) from users who wanted it, and since we are licensing the data for that, we might as well make it available in our SDK.  


    [Blog] [twitter] [LinkedIn]

    Wednesday, June 22, 2016 11:07 PM
  • Hi,

    The workaround works fine.

    JPL

    Thursday, June 23, 2016 12:24 PM
  • Update. This is now working correctly in the experimental branch. A fix was pushed out last week just before the weekend.

    [Blog] [twitter] [LinkedIn]

    Wednesday, July 6, 2016 11:58 PM
  • Ricky,

    Thanks for the update - much appreciated.

    I have switched to the experimental branch and it works fine - and the OS map tiles seem to load noticeably more quickly (probably an illusion, I know).

    P.S. I like the new rounded corners on infoboxes.

    JPL

    Thursday, July 7, 2016 9:11 AM