aboutsummaryrefslogtreecommitdiff
path: root/src/js/app/places.js
blob: d08955c0243169a4b4ede7754381bbff5c355573 (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: 'green',
  10. fillColor: 'rgba(110, 204, 57, 0.6)',
  11. fillOpacity: '1',
  12. });
  13. /*
  14. // bindTooltip was introduced in LeafletJS 1.0.
  15. try {
  16. marker.bindTooltip(
  17. feature.properties.name,
  18. {permanent: true });
  19. } catch (e) {
  20. if (console) {
  21. console.warn('tooltip skipped (using an old Leaflet?)');
  22. }
  23. };
  24. */
  25. return marker;
  26. };
  27. var place = L.geoJson([], {
  28. pointToLayer: returnMarker
  29. });
  30. return function(data) {
  31. place.addData(data);
  32. return L.markerClusterGroup().addLayer(place);
  33. };
  34. });