none
BING MAPs V8 and Microsoft.Maps.GeoLocationProvider RRS feed

  • Question

  • Hello All

    I am trying to convert some JavaScript code that I inherited that is used for BING Maps V7 and convert it to an equivalate BING Maps V8 syntax.
    The issue is that in BING Maps V8 “Microsoft.Maps.GeoLocationProvider” is no longer used.
    In the following code sniplet get’s built up and passed to the “Microsoft.Maps.GeoLocationProvider”

    _map = new Microsoft.Maps.Map(element,

                {

                    credentials: bingCredentials,

                    mapTypeId: Microsoft.Maps.MapTypeId.road,

                    width: _width,

                    height: _height,

                    center: new Microsoft.Maps.Location(49.6097, -125.3331),

                    zoom: _zoom,

                    showDashboard: true,

                    showMapTypeSelector: true,

                    enableClickableLogo: false,

                    enableSearchLogo: false,

                    fixedMap"color:blue;font-family:Consolas;font-size:9.5pt;">true

                });

    This is the “Microsoft.Maps.GeoLocationProvider” which is no longer supported in BING maps V8

    _geoLocationProvider = new Microsoft.Maps.GeoLocationProvider(_map);

    Both of these code segments are contained in a larger JavaScript function.

    I think what is used instead of “Microsoft.Maps.GeoLocationProvider” is HTML5 Geoloaction API navigator.geolocation.getCurrentPosition();

    I am not sure how to build up the _map variable to pass to navigator.geolocation.getCurrentPosition();

    My knowledge of using BING maps is very limited.
    Thursday, November 2, 2017 7:30 PM

Answers

All replies