none
Drill Down Choropleth map depends on selected boundary RRS feed

  • Question

  • Hi there, 

    Basically, I need to get "drill down" through data to get higher levels of detail. 

    Initially map shows at state level polygons and along with necessary info.. where i select one state, its needs to focus on that selected state and load county boundaries (polygon) and their details.

    Again, if selected anyone of the county level boundary, it has to show boundaries of zip level.

    Finally, if i selected zip level, it has to show records details.

    I could make all level boundaries using spatial data services. I would like to know how can implement interactivity through this.

    Can anyone help me achieve this. Awaiting for response from anyone. 

    Thanks in advance.

    Arun Nivas

    Tuesday, August 13, 2019 11:23 AM

Answers

All replies

  • Hi Arun,

    You will want to use a combination of the sample code at https://www.bing.com/api/maps/sdkrelease/mapcontrol/isdk

    Specifically look at event handling and SDS (with Entity like Postal Code)

    Sincerely,

    IoTGirl

    Tuesday, August 13, 2019 7:07 PM
    Owner
  • Hi IoTGirl,

    Thanks for your response.

    Yes.. I am using the same Events and SDS, by clicking event handler loads another level of detail (County level).

    I would want to show enlarge view of particular state and its county details when selected state.

    Is there any way to hide other non selected states.

    Note: Want to create Choropleth drill down map, so I have set Mercator Map type which hides base layer.

    Regards,

    Arun

    Friday, August 16, 2019 5:59 AM
  • Hi Arun,

    Q: Is there any way to hide other non selected states.

    A: Don't color those states 

    Sincerely,

    IoTGirl

    Friday, August 16, 2019 9:04 PM
    Owner
  • Hi IoTGirl,,

    Thanks for ur suggestion.

    I want to achieve like this demo in bing, but unable to bring this much smoothness.

    Please share if you have any guidance, how can do this. 

    Thanks in advance.

    -Arun

    https://miro.medium.com/max/700/1*qqu5TUCsfbBwO4_CyxT8mQ.gif

    Monday, August 19, 2019 4:02 PM
  • Hi,

    Hope you are doing well.

    I did similar functionalities using Spatial Data Service by Census Data source.

    https://v5qzqsdbkbwb7c8g48fz2q-on.drv.tw/BingMapsTest/SDS-State.html

    I could see State, County, Congressional District and Zip Data sources.

    Would like to know, is there any Data sources available for City level boundary information in public data source.

    Can you please assist.

    Regards,

    Arun 

    Monday, September 9, 2019 7:37 AM
  • Hi Arun,

    You probably want to look at the entity type value "Populated Place" for city values.

    Sincerely,

    IoTGirl

    Monday, September 9, 2019 10:18 PM
    Owner
  • Hi IoTGirl,

    Thanks for your reply.

    Yes, I can use your suggestion when I have a city/list of cities with me and by passing as arguments in getBoundary method.

    But I have few cities info  whereas I want to retrieve all city boundaries within the chosen state.

    var sdsStateDataSourceUrl = 'https://spatial.virtualearth.net/REST/v1/data/755aa60032b24cb1bfb54e8a6d59c229/USCensus2010_States/States';

    var sdsCountyDatasourceUrl = 'https://spatial.virtualearth.net/REST/v1/data/6c39d83e5812459f914832970618048e/USCensus2010_Counties/Counties';

    Previous REST API data source has complete info about State, County, Zip , but here I am not sure how to retrieve all the City names through GetBoundaryRequestOptions object & Microsoft.Maps.SpatialDataService.GeoDataAPIManager.getBoundary.

    Or It would be great if city info has like this datasource.

    Thank you..

    Arun

    Tuesday, September 10, 2019 8:26 AM
  • Hi Arun,

    My suggestion would be to use the "Previous REST API data source has complete info about State, County, Zip " you mention to get the city data you need and then call SDS "Populated Place" with the city list from that source.

    Sincerely,

    IoTGirl


    Tuesday, September 10, 2019 4:39 PM
    Owner
  • Hi IoTGirl,

    Here the problem is that, I am not getting city list from anyone of these public data sources.

    In the below code, I could pass few city names and got city boundaries using GeodataAPI..

    But I wanted to take all city boundaries for one particular State. For example, if "California" state chosen, all its city names and their boundaries should return.

    Is there any feature available right now.

    var locs = ['Los Angeles', 'Phoenix', 'atlanta', 'new york', 'dallas', 'san diego'];
    
    var geoDataRequestOptions = {
        entityType: 'PopulatedPlace',
        lod: 3,
        getAllPolygons: true,
        getEntityMetadata: true
    };
    
    Microsoft.Maps.loadModule('Microsoft.Maps.SpatialDataService', function () {
        //Use the GeoData API manager to get the boundary
        Microsoft.Maps.SpatialDataService.GeoDataAPIManager.getBoundary(locs, geoDataRequestOptions, map, function (data) {
            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: getLegendColor(10000), 
                        strokeColor: 'black'
                    });
    
                }
                map.entities.push(data.results[0].Polygons);
            }
    
        }, null, function errCallback(callbackState, networkStatus, statusMessage) {
            console.log(callbackState);
            console.log(networkStatus);
            console.log(statusMessage);
        });
    });

    Thanks,

    Arun

    Wednesday, September 11, 2019 8:44 AM
  • Hi Arun,

    Bing maps does not offer a service that returns all cities in a certain state. Ricky recommended a geonames source in https://social.msdn.microsoft.com/Forums/en-US/f024e378-6c33-4d40-8b36-f57b51b93647/use-bing-map-api-to-show-city-state-or-state-or-country-as-auto-suggestion

    Sincerely,

    IoTGirl

    Wednesday, September 11, 2019 6:22 PM
    Owner
  • Hi IoTGirl,

    Provided links are useful. Thanks for your all help.. :)

    Regards,

    Arun

    Thursday, September 12, 2019 1:15 PM
  • You are very welcome!
    Thursday, September 12, 2019 4:25 PM
    Owner