Google Maps Heatmap Layer API - Limit data points that can be displayed on a map?

I'm new to the Google Maps JavaScript JavaScript API, and I use the heatmap layer on Google maps, similar to the map map documentation example:

https://developers.google.com/maps/documentation/javascript/examples/layer-heatmap

I load a lot of data points for a heatmap, but only a limited amount is displayed.

I do not see any data problems; When I reduce the data set into smaller pieces, each time I load the map, a heat map appears in different places.

But I can see in the usage documentation ( https://developers.google.com/maps/documentation/javascript/usage ) that there is a limit of 2500 requests per day, t know what is the definition of a single request in this scenario.

Is this when the map is loaded using initMap() , does the entire HeatmapLayer a single request?

Or is it that when I create a heatmap with 4000 data points, each call to new google.maps.LatLng() for each data point counts 4000 separate requests?

+8
google-maps google-maps-api-3
source share
2 answers

Following the example in the documents, I created an example that creates 10,000 points for plotting on a heat map, without any problems. So it cannot be some kind of speed limit. There must be something else in the game. In this example, there is not even an API key, therefore, in a free plan.

Ten Thousand Floating Point Demos

 <div id="map"></div> <script> var map, heatmap; function initMap() { map = new google.maps.Map(document.getElementById('map'), { zoom: 2, center: {lat: 37.775, lng: -122.434}, }); heatmap = new google.maps.visualization.HeatmapLayer({ data: getPoints(), map: map }); } function getPoints() { var lotsOfMarkers = []; for( var i = 1; i <= 10000; i++) { var random = new google.maps.LatLng( (Math.random()*(85*2)-85), (Math.random()*(180*2)-180) ); lotsOfMarkers.push(random); } return lotsOfMarkers; } </script> <script async defer src="https://maps.googleapis.com/maps/api/js?&libraries=visualization&callback=initMap"> </script> 
+2
source share

Well, the Google Maps JavaScript API has the following limitations if you check the developer console.

enter image description here

This means that you can upload your card 25,000 times a day, and the user can only make 1 request per second. Although unlimited here means that cards can load at the same time.

Therefore, every time you call your API key, for example this , it is considered 1 load per day.

Note. Daily quotas reset at midnight Pacific Time (PT)

+4
source share

All Articles