简体   繁体   中英

Google Maps API limitations

I am working on a project where I am going to create a map over a specific area, and have some points-of-interest included. Thinking of the ones already included in Google Maps.

My first thought was that this could be done in the Google Maps API, but I've never worked with if before so therefor I have some questions about it's limitations and capability.

  1. Can I limit the map to one specific area?
  2. Can I filter the points-of-interest? Ex. only gas stations and hotels etc.

Thats about it to get me started at least.

Thanks!

You could limit the extents fo the displayed map by intercepting the pan controls (eg. intercepting the view-change messages; or implement your own and disable the standard ones). Note that if you zoomed out a lot, the out-of-area-map would still appear.

  1. Yes, you can restrict your geocoder search by specifying the bounds as described here

  2. AFAIK, no, unless you filter the results once you've obtained them

If you are using a spatial enabled db( postgis , mysql spatial ..) you can make spatial queries to filter your POI's.As of filtering according to type you should add a type column in your table to filter the results according to this column. Hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM