none
Polygon color not getting displayed on Bing map RRS feed

  • Question

  • Hi

    We are  unable to view polygon's on map returned by SpatialDataService.GeoDataAPIManager

    Recently we were able to plot polygon's returned by service with different color but now we are unable to do same.We have debugged  a sample code,in that we do get polygon's from service but are not able to plot them on Map with certain color's. 

    Sharing the sample code in which we are facing the difficulty:

      Microsoft.Maps.loadModule('Microsoft.Maps.SpatialDataService', function ()

    {

            //Use the GeoData API manager to get the boundary

            Microsoft.Maps.SpatialDataService.GeoDataAPIManager.getBoundary(states, geoDataRequestOptions, map, function (data) {

                counter++;

                if (data.results && data.results.length > 0) {

                    for (var i = 0; i < data.results[0].Polygons.length; i++) {

                        data.results[0].Polygons[i].setOptions({

                            fillColor: 'rgba(253,141,60,0.8)',

                            strokeColor: 'black'

                        });

                        array.push(data.results[0].Polygons[0].geometry.bounds);

                    }

                    map.entities.push(data.results[0].Polygons[0]);

                }

            });

        });

    }

    Thanks in advance.

    Thursday, September 7, 2017 2:20 PM

Answers