none
V8 Ordnance Survey maps not working if zoom greater than 11 RRS feed

  • Question

  • Hi,

    I've just started looking at updating my web app from V7 to V8 and fell at the first hurdle. I took the SDK "Load maps with options" and changed the mapType to ordnanceSurvey. No problem.

    I changed zoom from 10 to 12 (or greater) and it fails.

    The code I am using is: 

    <!DOCTYPE html>
    <html>
        <head>
            <title>loadMapWithOptionsHTML</title>
            <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
        </head>
        <body>
            <div id='printoutPanel'></div>
            
            <div id='myMap' style='width: 100vw; height: 100vh;'></div>
            <script type='text/javascript'>
                function loadMapScenario() {
                    var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
                        credentials: 'Your Bing Maps Key',
                        center: new Microsoft.Maps.Location(51.50632, -0.12714),
                        mapTypeId: Microsoft.Maps.MapTypeId.ordnanceSurvey,
                        zoom: 14
                    });
                    
                }
            </script>
            <script type='text/javascript' src='http://www.bing.com/api/maps/mapcontrol?branch=release&callback=loadMapScenario' async defer></script>
        </body>
    </html>

    Sunday, July 3, 2016 7:46 PM

Answers

  • There is a known issue with ordnance survey maps at the moment. If you try loading the map into that map type it will fail to load. A fix for this will be in the experimental branch soon if it isn't already there. That said you can work around this by loading the map into road and then after the line of code to load the map, use setView to change it to ordnance survey. As you likely know OS maps aren't available at all zoom levels but it should be the same as v7.

    [Blog] [twitter] [LinkedIn]

    Monday, July 4, 2016 2:28 AM

All replies

  • There is a known issue with ordnance survey maps at the moment. If you try loading the map into that map type it will fail to load. A fix for this will be in the experimental branch soon if it isn't already there. That said you can work around this by loading the map into road and then after the line of code to load the map, use setView to change it to ordnance survey. As you likely know OS maps aren't available at all zoom levels but it should be the same as v7.

    [Blog] [twitter] [LinkedIn]

    Monday, July 4, 2016 2:28 AM
  • Thanks Ricky. That will keep me going until the final fix is in place.
    Monday, July 4, 2016 8:12 AM