blob: 370bc95d1a37e229a1701ee9db2b9acc75bd959a (
plain)
- define([
- 'leaflet',
- 'leaflet.markercluster'
- ], function(L) {
- // GeoJSON feature grouping
- function returnMarker(feature, latlng) {
- var marker = new L.marker(latlng);
- // bindTooltip was introduced in LeafletJS 1.0.
- try {
- marker.bindTooltip(
- feature.properties.name,
- {permanent: true });
- } catch (e) {
- if (console) {
- console.warn('tooltip skipped (using an old Leaflet?)');
- }
- };
- return marker;
- };
- var place = L.geoJson([], {
- pointToLayer: returnMarker
- });
- return function(data) {
- place.addData(data);
- return L.markerClusterGroup().addLayer(place);
- };
- });
|