Marker Clusterer

谷歌地图 JavaScript API v3 的标记聚类库。「A marker clustering library for the Google Maps JavaScript API v3.」

Github stars Tracking Chart

Please note: This repository is kept for historical purpose only - the current version of marker clusterer is available as part of the v3-utility-library repository.

Marker Clusterer – A Google Maps JavaScript API utility library

A Google Maps JavaScript API v3 library to create and manage per-zoom-level clusters for large amounts of markers.
Analytics

Reference documentation

Migrated from the Google Maps JavaScript API utility libraries on Google Code.

Usage

Download or clone markerclusterer.js and images m1.png to m5.png, save images in images folder.

To use your own custom cluster images just name your images m[1-5].png or set the imagePath option to the location and name of your images like this: imagePath: 'customImages/cat' for images cat1.png to cat5.png.

index.html

...

<div id="map-container"><div id="map"></div></div>
<script src="markerclusterer.js"></script>
<script>
    function initialize() {
        var center = new google.maps.LatLng(51.5074, 0.1278);

        var map = new google.maps.Map(document.getElementById('map'), {
          zoom: 3,
          center: center,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        });

        var markers = [];
        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(51.5074, 0.1278)
        });
        markers.push(marker);

        var options = {
            imagePath: 'images/m'
        };

        var markerCluster = new MarkerClusterer(map, markers, options);
    }

    google.maps.event.addDomListener(window, 'load', initialize);
</script>
...

Live Demos

Marker Clusterer Screenshot

Examples page

Contributing

Want to contribute? Check out the contributing guide!

License

Copyright 2014 Google Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Main metrics

Overview
Name With Ownergooglearchive/js-marker-clusterer
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:Apache License 2.0
所有者活动
Created At2014-09-12 19:32:50
Pushed At2019-06-16 08:14:59
Last Commit At
Release Count0
用户参与
Stargazers Count1.3k
Watchers Count84
Fork Count764
Commits Count90
Has Issues Enabled
Issues Count89
Issue Open Count72
Pull Requests Count14
Pull Requests Open Count27
Pull Requests Close Count22
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private