Google Maps Multiple Instances - google-maps

I am new on google maps devlopment. I am using google map javasccript api v3.
using the below url
url : https://developers.google.com/maps/documentation/javascript/tutorial#api_key
I was able to generate the key that is required to generate/display map. I tried a sample example for this.
What I would actually like to know is: can we add multiple instances of google maps on a page at the same time?*
Also, I am bit confused like there is a limit for number of times a map can be loaded in a day (some 25,000) and if exceeds that there would be charge for the next request for that particular map?

1) In the Google Dev Console, it states that the Android Google Maps v2 call does not have a limit whereas regular Google Maps v2 has one set at (25,000). I would link to the console, but you have to be logged in.
2) No, I do not think that you can have multiple instances of maps running on one activity at a time.
Hope this helps.

Related

Launch Google Maps and Show a Pin in a specific Location action not working anymore

According to the google map api docs to launch Google Maps in a new browser window to show a pin using latitude/longitude coordinates is
https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393
Expected result as per the api docs
but instead displays the error message
Google Maps can't find 47.5951518,-122.3316393
Any suggestions for the correct way of using this api?
I typed your search string above in my browser URL and it works fine. Google Maps appeared for the desired area with the required pin. Please retry and make sure Google Maps services is up.

Link to Google Maps Directions using place_id

I have 2 Place IDs I've obtained via the Google Places API, and want to display a link to the Google Maps app for directions between those 2 places.
I see that it's possible to do this with 2 addresses based on the answer at Current Location - Google Maps - Link to Directions using the saddr and daddr query parameters
I also see that it's possible to link to a map with a place ID by prefixing place_id:... in the q query parameter from this answer at Getting Google Maps link from place_id
Is there a way to have a directions link with the Google place_id? I tried a URL like:
https://www.google.com/maps/dir/place_id:ChIJp4JiUCNP0xQR1JaSjpW_Hms/place_id:ChIJp4JiUCNP0xQR1JaSjpW_Hms and it doesn't seem to work
In order to open Google Maps directions mode with place IDs you have to use Google Maps URLs. The Google Maps URLs in directions mode support parameters origin_place_id and destination_place_id.
Create the following URL for example (note that origin and destination parameters are also mandatory as per documentation)
https://www.google.com/maps/dir/?api=1&origin=Yukar%C4%B1%20Bah%C3%A7elievler%2C%2070.%20Sk.%2017%2FB%2C%2006490%20%C3%87ankaya%2FAnkara%2C%20Turkey&origin_place_id=ChIJp4JiUCNP0xQR1JaSjpW_Hms&destination=Be%C5%9Fikkaya%2C%202044%2F1.%20Sk.%2C%2006230%20Alt%C4%B1nda%C4%9F%2FAnkara%2C%20Turqu%C3%ADa&destination_place_id=ChIJn-ZptRFT0xQRGUyoJX2s8Wc
Have a look at the documentation for further details.
I hope this helps!

How to find distance between two coordinates using google maps SDK for ios?

I have an ios application which uses default Apple map for displaying selected records on map. Now I have to add a button "Drive Route" which launches google maps installed on device and show direction from current location to selected records .I already did this by using Google Maps URL Scheme for ios.
Now i want to know the distance and Travel time between selected records and current location. I found that we can do this by using Distance Matrix API like this :
"https://maps.googleapis.com/maps/api/distancematrix/json?units=metric&origins=(a_coordinate_string)&destinations=(b_coordinate_string)&key=<#GOOGLE_API_KEY#>"
But I want to use Google Maps SDK methods to get desired result.
NOTE : I have used Places SDK for ios , where we have Methods AutocompleteQuery () etc.
Does Google Map SDK provide any Methods to get desired Distance and Travel time?
Please, help me.
Thanks in advance.
Google Maps SDKs currently do not have this kind of feature. You will need get the results programmatically via Distance Matrix Web Service request.
If you would like to have this feature available in the Google Maps SDKs, you may file this as a feature request in Public Issue Tracker:
https://developers.google.com/maps/support/#issue_tracker

Different Images on Google Maps API StaticMap Than on Google Maps

I am getting different building shadows when calling https://maps.googleapis.com/maps/api/staticmap?center=40.1150139,-88.2273797&zoom=17&size=600x400&maptype=satellite
vs what I get from visiting
https://www.google.com/maps/#40.1150139,-88.2273797,319m/data=!3m1!1e3
I assume these are taken at different times of the day. How can I get the same image I am getting from Google Maps by calling the API?
There is no way to get satellite imagery for different timestamps via Google Maps Static Maps API at the moment.
The Google issue tracker contains a feature request to make it possible. You can have a look at the feature request:
https://issuetracker.google.com/issues/35826354
Feel free to star it to add your vote and subscribe to notifications.

Generating a link to Google Maps from a directions API response

I currently have an application which takes a a start and end point from a user and sends a request to the google maps directions API, for example: https://maps.googleapis.com/maps/api/directions/xml?key=my_key8&origin=M460PU&destination=NN36NW&sensor=false&mode=driving&units=imperial&departure_time=1501752779
We then display the estimated journey time for a given route. The user has asked if it's possible for us to include a link directly to Google maps so that they can see the route on the maps and make sure it looks ok.
I've seen previous questions such as this one: Link to Google Maps but that seems to be a solution for a simple Google Maps search, where as in my case I want to see a route from the directions API.
I'm trying to figure out if I there's a way I can take the data from the Directions API response and plug that in to a http://maps.google.com/maps URL that the user can click on. Has anyone ever had any success doing this?
As mentioned #geocodezip you should use Google Maps JavaScript API or Google Static Maps API in order to show exactly the same route as the output of Directions API.
There is also an option to open Google Maps web site or native app using the Google Maps URLs. You can have a look at the documentation to figure out how to create the URL:
https://developers.google.com/maps/documentation/urls/guide#directions-action
The only issue is that the Google Maps URLs doesn't provide any parameter for departure time, so you will always get routes for "Leave now" that might have discrepancies comparing to a web service that was requested for a different departure time.
Based on your question I think the Google Maps URL might be
https://www.google.com/maps/dir/?api=1&origin=M460PU&destination=NN36NW&travelmode=driving