-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
765 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
The API is similar to that of the Google Maps version ([1]): | ||
|
||
var map = new L.Map('map'); | ||
var lat = ...; | ||
var lng = ...; | ||
var pos = new L.LatLng(lat, lng); | ||
var zoom = 4; | ||
map.setView(pos, zoom); | ||
|
||
var clusterer = new LeafClusterer(map); | ||
|
||
var lat = ...; | ||
var lng = ...; | ||
var pos = new L.LatLng(lat, lng); | ||
var marker = new L.Marker(pos); | ||
clusterer.addMarker(marker); | ||
|
||
or for batched addition: | ||
|
||
var markers=[]; | ||
for each marker (m) { | ||
markers.push(m); | ||
} | ||
|
||
clusterer.addMarkers(markers); | ||
|
||
|
||
|
||
[1] http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/ | ||
|
||
|
||
|
Oops, something went wrong.