none
How to make a pushpin disappear when city/country combo invalid RRS feed

  • Question

  • I was just wondering what the syntax would be to make a pushpin disappear when the combination of a city and country does not exist.

    For example: If I use the location of a invalid city with a country such as XYZ, United States, it posts a pushpin in the very center of the United States. I would rather have it not post a pushpin at all in this situation

    I know I can use a simple if statement to test to see if the city is null or blank and then set the pushpin to blank to make it disappear, however, I don't know how to create a statement to check if the city is actually valid in bing maps.

    Any suggestions?

    Wednesday, September 12, 2012 7:57 PM

Answers

  • In that case take a look at the entityType property of the response from the REST service. This will tell you the type of data being returned. Check to see if the result is a CountryRegion and if it is then it returned a country so ignore it. You can also check to see if it is a different type. Here is a list of all the supported Entity types:

    http://msdn.microsoft.com/en-us/library/ff728811.aspx


    http://rbrundritt.wordpress.com

    Friday, September 14, 2012 8:23 AM

All replies

  • Which map control are you using and how are you doing your geocoding? Find Method in V6.3, Search module in V7, REST services?

    http://rbrundritt.wordpress.com

    Thursday, September 13, 2012 9:18 AM
  • Which map control are you using and how are you doing your geocoding? Find Method in V6.3, Search module in V7, REST services?

    http://rbrundritt.wordpress.com

    I am using V7 and calling the REST services.

    Thursday, September 13, 2012 1:50 PM
  • In that case take a look at the entityType property of the response from the REST service. This will tell you the type of data being returned. Check to see if the result is a CountryRegion and if it is then it returned a country so ignore it. You can also check to see if it is a different type. Here is a list of all the supported Entity types:

    http://msdn.microsoft.com/en-us/library/ff728811.aspx


    http://rbrundritt.wordpress.com

    Friday, September 14, 2012 8:23 AM