Google Maps API is used in the company's projects, and marker is used for Google API development to label locations on Google Maps.
But Google marker also has a problem with the use of the process, that is, if the Google map to mark a large number of marker, one is easy to cause Google Maps load slow, the other is marker too much, the map is very
It's not nice, even if you can't see it, because you'll find the map is occupied by these marker.
In the Google Maps API, a cluster is provided to solve this problem, that is, Markerclusterer,
We used the library (provided by Google): https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/ Markerclusterer.js
Then the image tag URL on Google Maps is: https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m
In general, JS uses the following:
var mc = new Markerclusterer (map, markers, {
ImagePath: ' https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m '
});
However, in 12/05/2016, Google decommissioned the google-maps-utility-library-v3.googlecode.com source for this library. That said, Google stopped using the library on May 12 this year, and Google moved it to GitHub.
GitHub Address: Https://cdn.rawgit.com/googlemaps/js-marker-clusterer/gh-pages/src/markerclusterer.js
Https://github.com/googlemaps/js-marker-clusterer
Https://github.com/googlemaps/js-marker-clusterer/blob/gh-pages/src/markerclusterer.js
Picture address is Https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images
How do you use it in your development environment? Use the following steps:
1. Find your link on GitHub, and click to the "Raw" version of the file.
2. Copy the URL, and link to it
3. Change raw.githubusercontent.com to Rawgit.com (non-production) or cdn.rawgit.com (production)
So, in Markerclusterer.js, put the image address by https://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images
Change to Https://cdn.rawgit.com/googlemaps/js-marker-clusterer/gh-pages/images
Use of Google Maps Library