How can I exclude any location returned by maps API that is not a town, city, region or country? -


I was going through google () via the Geocoding and reverse geo encoding API but it is a little confused.

When my user searches for a place on my page connected to Google Maps API - if the user does not choose any village, city, region, country - I want to throw a proper message.

For example, if the user completes Google for Taj Mahal, "Taj Mahal, Agra, Uttar Pradesh, India", then I will send a message to "I only select Village, City, Region, Country I can. " Do you want to select Agra?

then

  • The user should be allowed to choose no at the street level eg 23, Park Lane, London
  • The user should be allowed to choose only from a village / city / city level, or something similar. It is being said that where I am working on National Park

Is there a feature where I can keep an address and check that Google Maps ap What does E give as its values ​​- e.g., short name, administrative_area_level_1 etc

It is required that you want to hold and propose as the type type of type .

For the demo the following .

I get the result against the following types:

  var type = ['locality', 'post_space', 'country'];  

Of course You will need to adjust these filters for your needs, but you need what you want to achieve.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -