define(['leaflet'], 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.layerGroup().addLayer(place); }; });