none
Spatial Data Services not working for some latitude and longitude RRS feed

  • Question

  • Hi,

    We use Spatial Data Services to plot multiple boundary(polygon) on map. we have write sample code as below where we simply pass a location to get the boundary but it not return any result in success or error callback of getBoundary().

    function loadMapScenario() {
                var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
                });
                //Create an array of locations to get the boundaries of
                var location = [];
                var loc1 = new Microsoft.Maps.Location(39.42472, -76.78683);
                location.push(loc1);
                var geoDataRequestOptions = {
                    entityType: 'PopulatedPlace',
                    getAllPolygons: true
                };
                Microsoft.Maps.loadModule('Microsoft.Maps.SpatialDataService', function () {
                    //Use the GeoData API manager to get the boundary
                    Microsoft.Maps.SpatialDataService.GeoDataAPIManager.getBoundary(location, geoDataRequestOptions, map, function (data) {
                        if (data.results && data.results.length > 0) {
                            map.entities.push(data.results[0].Polygons);
                        }
                    }, null, function errCallback(callbackState, networkStatus, statusMessage) {
                        console.log(callbackState);
                        console.log(networkStatus);
                        console.log(statusMessage);
                    });
                });
            }

    When we debug the code we saw that it give error from mapcontrol.js as below error:

    "Uncaught TypeError: Cannot read property 'length' of undefined"

    Screenshot:

    thanks in advance

    Monday, March 19, 2018 2:41 PM

Answers

  • Any fixes will get pushed out to our Experimental Branch first.   After a fix has been in our Experimental Branch for a month will then make it into Release Branch which gets updated on a monthly basis.    

    I am working with our Development Team to get an ETA on a fix.    

    If you have a Bing Maps Enterprise License, please contact Bing Maps Enterprise Support or e-mail me directly at v-stdubi (AT) microsoft.com and we will create a case for you and provide you direct updates.

    Wednesday, March 21, 2018 9:48 PM
    Moderator

All replies

  • Thank you for letting us know I am able to reproduce the behavior when the "getAllPolygons: true" parameter is set.  The issue occurs when the Geodata query returns no results.  

    We have reported this issue to our Development Team to investigate further.  

    Monday, March 19, 2018 6:27 PM
    Moderator
  • Thank you for quick response,

    Do you have any idea when this issue will get resolve because our project will go live next week and we cannot go with such issue on online.

    Thanks again.

    Wednesday, March 21, 2018 7:18 AM
  • Any fixes will get pushed out to our Experimental Branch first.   After a fix has been in our Experimental Branch for a month will then make it into Release Branch which gets updated on a monthly basis.    

    I am working with our Development Team to get an ETA on a fix.    

    If you have a Bing Maps Enterprise License, please contact Bing Maps Enterprise Support or e-mail me directly at v-stdubi (AT) microsoft.com and we will create a case for you and provide you direct updates.

    Wednesday, March 21, 2018 9:48 PM
    Moderator