Google Maps API limitations - google-maps

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.
Can I limit the map to one specific area?
Can I filter the points-of-interest? Ex. only gas stations and hotels etc.
Thats about it to get me started at least.
Thanks!

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

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.

Yes, you can restrict your geocoder search by specifying the bounds as described here
AFAIK, no, unless you filter the results once you've obtained them

Related

Is it possible to have custom avoidance details for Google Maps API?

Google Maps API allows you to avoid tolls, ferries, and other such common annoyances. Is there some way to have the routing engine avoid specific places? I want to take a list of places from the Places API and then create a route that avoids them ... sort of the opposite of waypoints.
Possible? Or do I need to write my own algorithm for this?
It's basically a yes/no. Either the routing engine can take this info (show me how), or it can't. Apparently the answer is "No, it can't" according to the comment below and this is now solved.
Feature request in the issue tracker:
Issue 214: Ability to influence Directions (e.g. "avoid" / "roadblock")

Free geocode API allowing store names and coordinates

My application should allow users to store events and their locations and then perform search on them - so I need those locations in my database with their names and latitudes/longitudes. Google API doesnt allow storing anything else but place IDs so I have to find something else that can autocomplete/suggest places on UI and allow storing it my database.
Does anyone know such a good service?
You can simply add your points in your DB based on each point Lat & Long values. So when user is searching somewhere you have his current location(Lat-Long), Therefore you can search in your DB and get the distance of each saved point with current location and retrieve the results you want to show (i.e in JSON format).
In client-side use some auto-complete jquery library to show the nearby places and somethings like that (with additional information).
Google Map API has a service that you can show some custom marker on the map with your custom configuration like marker icon, description and etc. You can show your additional information in description as HTML format.
You can see some example here:
Customizing a Google Map: Custom Markers
Hope these tips would be helpfull. Regards.
Suddenly I've found an answer that helps me:
https://productforums.google.com/forum/#!topic/maps/hNc1OOU6Zm8
So I can use some Google's data under some conditions.

Locating current Google Place i'm at by latitude/longitude via Google Places API

i have a lat/long location data and i need to get current Google Place where i'm at now.
For example, if i'm in a shop(cafe, gym, etc..), i need to get info about THAT particular shop(cafe, gym, etc..).Or at least the closest one.
So, i'm doing it this way:
First i fetch place basic info(placeid,name, etc.) via Google Places API Nearby Search request:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.7597351,-73.9836576&radius=16.66&key=...
Then i find the closest one(which is apparently where i am) and perform Place Details request with it's placeid
So, everything works fine, except for some places like the one located at 40.7597351,-73.983657 (New York Guitar lab shop) which i can see on google map, but can't get in my response. Even places that are further from my location than this, are being found fine.
I've already tried to use rankBy=distance and then checking if the result is in required radius manually, still no use. Actually, maybe this approach is right, but as told in the docs, it's required to use types parameter with rankBy=distance. So, i set types=establishment since i actually need everything except addresses and locality tokens returned. I think that the problem is some places i need, are neither counted as establishments nor as localities, but i don't know the optimal way to exclude
all types specified at (https://developers.google.com/places/documentation/supported_types) Table 2 from my response. Is there a way to get only places which types are in Table 1 (except for specifying them ALL in my types param, haha)
So, could you please help me with how can i do this?
Thanks:)
P.S. here is very similar but unaswered question
Google Places API Displaying Inaccurate Result
It seems that there's explanation here (https://developers.google.com/places/faq#why_are_some_places_never_returned_even_though_they_have_google_pages). Looks like some places are just not yet verified by Google.
And yes, the establishment is the generic category for all non-localities. So you can be sure that if you set type=establishment then you'll have as much places as you will, if you'll specify all types from Table 2. Good Luck!

Add Markers to Google Maps based upon type of business

Using the Google Maps Api v3 I am wandering what the simplest method is to add Markers to my map based upon a certain type of business.
E.g. Display markers of coffee shops, or dentists etc etc...
I understand this will probably be achieved by manipulating the MapOptions I am just yet to figure it out.
Thanks in advance,
Dan
I answer quickly but I guess that because you posted your question here you are building a web application and you have a MAP and you want to retrieve particular type of business and display the result on your map.
You can get the result based on certain types of business.
This is the official guide to get places:
To see which are the type of "places" the API support click here.

get all possible directions from A to B

I want to find all possible routes from point A to point B (not only shortest ones). So my question is, is there any web service api (because I use Java) for such request in Google Maps, Yahoo Maps etc. it doesn't matter which one..
I've found something about this topic in Google Maps Directions Api: "alternatives (optional), if set to true, specifies that the Directions service may provide more than one route alternative in the response. Note that providing route alternatives may increase the response time from the server." But unfortunately, I couldn't use this option, when I include alternatives=true inside request query I get the same result. That would be nice to have such an alternative - it's more flexible, but I found something guarantied one with waypoints (but its much like "hardcoding" - we specify streets that we will pass from). Anyone tried alternatives=true?!
Here's another approach and solution for this problem: convert meters to latitude longitude from any point
Thanks for your responses..
I'm using the fact that google maps' paths uses rounding boxes to get a circle, to do so i just choose the point that i want and create a route to another that is not the same but very very close to it, just like:
http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=color:0x5600FF80|weight:100|51.5285582,0|51.5285583,0&sensor=false&zoom=15
We can choose the weight as the diameter of the circle, note that it is a fixed value, not related to the screen size and the zoom.