aboutsummaryrefslogtreecommitdiff
path: root/src/js/app/places.js
blob: f27eacdaef86b16c2895260b7107b317f5a2cb5d (plain)
  1. define([
  2.     'leaflet',
  3. 'leaflet.markercluster'
  4. ], function(L) {
  5. // GeoJSON feature grouping
  6. function returnMarker(feature, latlng) {
  7. // var marker = new L.marker(latlng);
  8. var marker = new L.CircleMarker(latlng,{
  9. color: 'none',
  10. fillColor: 'rgba(110, 204, 57, 0.6)',
  11. fillOpacity: '1',
  12. });
  13. // bindTooltip was introduced in LeafletJS 1.0.
  14. try {
  15. marker.bindTooltip(
  16. feature.properties.name
  17. );
  18. } catch (e) {
  19. if (console) {
  20. console.warn('tooltip skipped (using an old Leaflet?)');
  21. }
  22. };
  23. return marker;
  24. };
  25. var place = L.geoJson([], {
  26. pointToLayer: returnMarker
  27. });
  28. return function(data) {
  29. place.addData(data);
  30. return L.markerClusterGroup().addLayer(place);
  31. };
  32. });