locked
Ordnance Survey maps not working properly RRS feed

  • Question

  • I've been using OS maps without a problem for years, but just recently a major problem has emerged. When the map is moved the newly visible area shows only the road map. The part of the map which was previously visible and has remained visible shows an area of the OS map (see below). Unfortunately it's not quite as simple as that though. At first it works fine, but if you leave the page for a while (30 minutes or so) and then try moving the map you often see the issue.

    I've tried switching to the road map and then back to the OS map, but that does not fix it. A page refresh gets things working... until the next time. Other users are seeing the same issue.

    Example of Ordnance Survey fail

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
        <meta charset="utf-8" />
    
        <script type='text/javascript'
                src='http://www.bing.com/api/maps/mapcontrol?callback=GetMap&key=Key goes here' 
                async defer></script>
        
        <script type='text/javascript'>
        function GetMap()
        {
            var map = new Microsoft.Maps.Map('#myMap', {
    					mapTypeId: Microsoft.Maps.MapTypeId.ordnanceSurvey,
    					center:new Microsoft.Maps.Location(51.78, -2.65),
    					zoom:12
    				});
        }
        </script>
    </head>
    <body>
        <div id="myMap" style=";width:1800px;height:900px;"></div>
    </body>
    </html>


    • Edited by Kaiser Pete Tuesday, March 13, 2018 5:20 PM
    Tuesday, March 13, 2018 5:18 PM

Answers

  • OS tiles are locked down and only work with Bing Maps keys, behind the scenes in V8 it automatically appends the session key to each tile request. If an invalid or expired key is passed in, it will return road map tiles instead.

    I'm assuming you are using a basic key. Session keys that are generated from basic keys expire after about 30 minutes to an hour. As such, when it does expire, the OS map tile requests return road map tiles instead. There are two options; reload the map every 30 minutes or so, or get a Bing Maps license and use an enterprise key which generates map sessions that last much longer.


    [Blog] [twitter] [LinkedIn]

    Tuesday, March 13, 2018 5:42 PM
  • The session starts the first time a map is loaded on the page. Loading additional maps on the page does not generate new sessions, but uses the existing one. This allows people to have multiple maps on a single page and only generate one billable map session.

    To generate a new session, you have to reload the page, not the map.


    [Blog] [twitter] [LinkedIn]

    Wednesday, March 14, 2018 3:19 PM
  • This issue will only occur to those using free developer accounts only after using the map for an extended period of time which is fairly uncommon. Bing Maps is and enterprise platform, the free basic keys are for development of your app, once it is in production you should have a license. 

    [Blog] [twitter] [LinkedIn]

    Wednesday, March 14, 2018 7:54 PM

All replies

  • OS tiles are locked down and only work with Bing Maps keys, behind the scenes in V8 it automatically appends the session key to each tile request. If an invalid or expired key is passed in, it will return road map tiles instead.

    I'm assuming you are using a basic key. Session keys that are generated from basic keys expire after about 30 minutes to an hour. As such, when it does expire, the OS map tile requests return road map tiles instead. There are two options; reload the map every 30 minutes or so, or get a Bing Maps license and use an enterprise key which generates map sessions that last much longer.


    [Blog] [twitter] [LinkedIn]

    Tuesday, March 13, 2018 5:42 PM
  • What a pain. Has this recently been introduced? as I frequently leave sessions open for days at a time and it has never been a problem until now.
    • Edited by Kaiser Pete Tuesday, March 13, 2018 6:26 PM
    Tuesday, March 13, 2018 5:56 PM
  • There was always a limit, but the limit for basic accounts had to be reduced as they were being heavily abused. 

    [Blog] [twitter] [LinkedIn]

    Tuesday, March 13, 2018 6:52 PM
  • This doesn't resolve the issue, it just reloads the map, but after 30 mins or so it still reverts to the road map. Could you point out what I am doing wrong please?

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
        <meta charset="utf-8" />
    
        <script type='text/javascript'
                src='http://www.bing.com/api/maps/mapcontrol?callback=GetMap' 
                async defer></script>
        
        <script type='text/javascript'>
    	var map;
    	setInterval(keepalive, 1200000);
    
    	function keepalive() {
    		var zoom = map.getZoom();
    		var center = map.getCenter();
    
            	map = new Microsoft.Maps.Map('#myMap', {
    				credentials: 'key here',
    				mapTypeId: Microsoft.Maps.MapTypeId.ordnanceSurvey,
    				center: center,
    				zoom: zoom
    			});
    	}
    
        function GetMap() {
            map = new Microsoft.Maps.Map('#myMap', {
    				credentials: 'key here',
    				mapTypeId: Microsoft.Maps.MapTypeId.ordnanceSurvey,
    				center: new Microsoft.Maps.Location(51.78, -2.65),
    				zoom: 12
    			});
        }
        </script>
    </head>
    <body>
        <div id="myMap" style=";width:1800px;height:900px;"></div>
    </body>
    </html>


    • Edited by Kaiser Pete Wednesday, March 14, 2018 12:05 PM
    Wednesday, March 14, 2018 12:03 PM
  • The session starts the first time a map is loaded on the page. Loading additional maps on the page does not generate new sessions, but uses the existing one. This allows people to have multiple maps on a single page and only generate one billable map session.

    To generate a new session, you have to reload the page, not the map.


    [Blog] [twitter] [LinkedIn]

    Wednesday, March 14, 2018 3:19 PM
  • I was afraid you were going to say that.

    I don't see how timing out sessions so quickly benefits anyone.

    • Bing Maps will get more session requests, as users will have to restart the app to get useful OS tiles.
    • More tiles will have to be reloaded.
    • Users' experience is poor.
    • Perception of Bing Maps is poor.
    • My app is a free app (basic key), so Bing won't generate any money either way.

    You may already have guessed, but I'm really disappointed and my users will be too.

    Wednesday, March 14, 2018 3:33 PM
  • This issue will only occur to those using free developer accounts only after using the map for an extended period of time which is fairly uncommon. Bing Maps is and enterprise platform, the free basic keys are for development of your app, once it is in production you should have a license. 

    [Blog] [twitter] [LinkedIn]

    Wednesday, March 14, 2018 7:54 PM
  • The official page says, "The Basic Bing Maps Key is for use with consumer-facing, education, and non-profit applications as well as for internal commercial Windows or Windows Phone applications that qualify for free use."

    Dev/Test is just one of nine categories. I signed up for "Public and internal website, and mobile apps that are not on/for the Windows Phone: Maximum 125,000 cumulative billable transactions per calendar year at no charge."

    Thursday, March 15, 2018 9:24 AM
  • Sure, but you are using the platform for free (unlicensed). Which means there are tighter restrictions and not SLAs. Most enterprise applications wouldn't use a service without an SLA. Limitations need to be enforced otherwise a select few will drastically abuse this service any way they can (they already do).

    [Blog] [twitter] [LinkedIn]


    Thursday, March 15, 2018 4:47 PM