I'm using Google Maps API to set location markers. Will placing e.g 10 marks using setMap() be "charged" by Google ten times or one time?
As far as I understand, setMap() just sets markers on an already "charged" API call. I just want some confirmation on this.
If you are just placing markers by coordinates, the only quota that would apply would be for the API, which is counted by "API loads" from google's server (typically one per page view)
Related
I'm trying to wrap my head around what counts against the API call quota.
I have a page with a map, the map has 5000 locations marked on it.
Does google count the 1 page load or the 5000 locations it marked on the map?
You can find the answer to this in the new documentation Understanding Billing for Maps, Routes, and Places
From the SKU: Dynamic Maps
A web page or application that displays a map using the Maps JavaScript API. A map is created with the google.maps.Map() class.
User interactions with the map, such as panning, zooming, or switching map layers, do not generate additional map loads.
This also mean that Drawing on the Map does not count as map load since it does not need to call the google.maps.Map() for each overlay.
However, if you are retrieving the latitude and longitude for a place or street address with Places Library or Geocoding Service to display the markers, then it means you are making a request using those APIs and will be charged separately.
If your Javascript Map instantiates a Street View, this will also be charged separately as per the documentation
In JavaScript, with the google.maps.StreetViewPanorama() class or Map.getStreetView() method (prior to the new pricing, Map.getStreetView() was not charged). Usage of the StreetViewService() class is not charged.
Hope this helped!
I have Google premium account.
I am using google map javascript api for showing map on our website.
Feature of map like
Load the map
Place the markers programmatically with coordinates.coordinates already stored in database. i used those coordinates to place the markers.
so my question is that what is the limitations for above features for premium account? Is there any limit that how may times we can load the map and place the marker.
I have seen some requests limit for directions and other things. but i am not using direction feature.
Thanks!!!
When you use a Premium plan Google Maps JavaScript API map loads will be counted against the purchased map credits. Map load is incurred when you show a map in your application. Interactions like zoom, pan or create new marker are not counted.
There is no daily limit, you can use maps while your map credits are not exhausted.
Client side services (geocoding, directions, distance matrix) and places library will consume your map credits as well.
For more details I can suggest reading the documentation:
https://developers.google.com/maps/premium/usage-limits
Really quick/simple question that will determine which map API i use for my project.
I dont need an example- ill figure that out, i just need to know if the capabilities are there.
If i have store geocode (latitude, longitude) coordinates in a database, can i put one of those little red markers on a google map without having to actually make a geocoding request from google?
Additional question:
Also, would it count towards any quotas every time i display one of their maps, even if i give them the geocoded coordinates? Because i mean technically their map still has to find those coordinates...
Q1: Yes — you tell the API the coordinates of where to put the marker, rather than get Google to find those coordinates.
Q2: The usage limits are published by Google. You can have up to 25000 map loads per day. If you don't use the geocoder because you provide the coordinates yourself, then you don't use a geocoder access.
I have a Google spreadsheet with one column of physical addresses, and I want to have a second column be the time in minutes to walk between the address in column 1 and a second address (as determined by Google Maps). Any recommendations on how to accomplish this task?
From my understanding of the Google Maps terms of service, they:
don't like people using their service as a "batch geocoder". This means that
you will need to throttle your requests (place delays between each successive request, to avoid the OVER_QUERY_LIMIT error)
it is against the terms of service to use the geocoder (and maybe the distance service) without displaying a map graphic
If you still want to proceed,
you need some way of extracting the address from your spreadsheet. I think there's a Google docs API that will help you do that. I also found some custom Javascript code that does that for you easily. I don't have a link anymore :(
once you have the addresses readable from the Google Maps Javascript API, you can call the distance or directions API to get the walking distance
then you need to save that back to the spreadsheet.
It sounds like a possible application for the Distance Matrix Service.
But you can only use it if you will be displaying a map
Use of the Distance Matrix API must relate to the display of
information on a Google Map; for example, to determine
origin-destination pairs that fall within a specific driving time from
one another, before requesting and displaying those destinations on a
map. Use of the service in an application that doesn't display a
Google map is prohibited.
thats my scenario: I want to load a list of places of interest of a user based on his location (using HTML5 geolocation). But the problem is, I have a very big list of places (I don't want to have to load all places from my database), so the solution I have adopted until now is only to call mysql for the results in a given radius from the user, let's say, 1 km. But I'd like when user is dragging google maps to explore the map, load progressively the places for the area is shown on the map (basically something similar to what foursquare does).
Is there any simple way to achieve that? Hope I was clear with the question, thanks in advance, any help is appreciated.
Jesús.
General approach:
get the bounds of the map and query your data base for markers that are currently in view
optional, add padding to the bounds so some markers are available just out of view if the map is dragged
display the resulting markers
when the map is moved (bounds_changed event), query your database for additional markers
process through the returned markers, only adding those that are new (requires an array of existing markers and a way to determine that the existing marker and a newly downloaded marker are the same)
Searching the Google Maps API v3 group (and the Google Maps API v2 group, the concepts will apply but the code samples may not) should give you some examples.