Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps API, does adding a marker cost anything towards usage limit?

I am creating a webpage and using the Google Maps JavaScript API. I was wondering if adding a marker to the map after it has been loaded costs anything towards your usage limit? The API says you get 25,000 free map loads but they say nothing about what constitutes as a map load or at least I can't find it.

I am also wondering if I am allowed to store latitude and longitude coordinates from the Google Geocoding API. I assume I would be able to since lat and long coordinates are public information and I could get them from anywhere. Just curious because I need to run through a list of around 1200 elements and there are gonna be a lot of people using this so it would be nice if I didn't have to geocode the address every time.

I have been struggling for a while now and was wondering if anyone could help. Thanks in advance!!

like image 609
FlashpointGaming Avatar asked Jun 20 '17 19:06

FlashpointGaming


2 Answers

There is an accurate explanation regarding map loads in the FAQ section of Maps APIs:

A single map load is charged when any of the following occur:

  • A web page or application displays a map using the Google Maps JavaScript API.
  • A web page or application displays a Google Street View Image API panorama using the Google Maps JavaScript API. If a Street View panorama replaces a map in the same div element, the panorama is not charged.
  • An application requests a single map image from the Google Static Maps API.
  • An application requests a single panorama image from the Google Street View Image API.

https://developers.google.com/maps/faq#usage_mapload

As you can see adding a marker is not charged. Only new google.maps.Map(element, options) or new google.maps.StreetViewPanorama(element, options) can incur the map load in Maps JavaScript API.

Referring to storing data, terms of service allows to cache data for 30 days. Have a look at section 10.5 (d). It says:

No caching or storage. You will not pre-fetch, cache, index, or store any Content to be used outside the Service, except that you may store limited amounts of Content solely for the purpose of improving the performance of your Maps API Implementation due to network latency (and not for the purpose of preventing Google from accurately tracking usage), and only if such storage:

  • is temporary (and in no event more than 30 calendar days);
  • is secure;
  • does not manipulate or aggregate any part of the Content or Service; and
  • does not modify attribution in any way.

https://developers.google.com/maps/terms?#section_10_5

Also, note that place IDs are exempt from the caching restrictions, so you can store them without time limit:

https://developers.google.com/places/place-id#save-id

I hope my answer clarifies your doubt!

like image 59
xomena Avatar answered Sep 20 '22 18:09

xomena


This is bit to long for a comment

The number of free maps load is calculated for each time you reload a page .. alias when a new request for google maps apis is send to google ..

then if you add a marker using a ajax and create marker without a new load of HTML page you dont cost ... if you perform a reload for add the marker .. you cost.

like image 45
ScaisEdge Avatar answered Sep 21 '22 18:09

ScaisEdge