blob: 7ae50087735e45b9f46324b17093a3b1ee0a6ea5 (
plain)
- define([
- 'leaflet',
- 'leaflet.markercluster'
- ], function(L) {
- // GeoJSON feature grouping
- function returnMarker(feature, latlng) {
- var marker = new L.CircleMarker(latlng,{
- color: 'none',
- fillColor: 'rgba(110, 204, 57, 0.6)',
- fillOpacity: '1',
- });
- // bindTooltip was introduced in LeafletJS 1.0.
- try {
- marker.bindTooltip(
- feature.properties.name
- );
- } 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({
- maxClusterRadius: 10
- }).addLayer(place);
- };
- });
|