Specific marker color in moderation

recurrent
echarp 7 years ago
parent 6e112606bd
commit d46608823e
  1. 17
      app/assets/javascripts/maps.js.coffee
  2. 2
      public/assets/.sprockets-manifest-ab661426d97300c73ef9f54813a90d69.json
  3. 2
      public/assets/.sprockets-manifest-cc0c9f43a35675d2248a689be654ce22.json
  4. 75792
      public/assets/application-a6c4db9b7bd87ad8f4f5f63ab3fce13c0237f4c78cb41140f9dcda4bc55cdcb0.js
  5. BIN
      public/assets/application-a6c4db9b7bd87ad8f4f5f63ab3fce13c0237f4c78cb41140f9dcda4bc55cdcb0.js.gz

@ -53,23 +53,28 @@ $(document).ready ->
).addTo map
url = $(this).data 'url'
markerColor = markerColors[idx++ %% markerColors.length]
if location.search && url.indexOf('?') >= 0
url += '&' + location.search.substr 1
else
url += location.search
# Marker with the proper icon
marker = L.AwesomeMarkers.icon
prefix: 'fa',
icon: 'calendar',
markerColor: 'cadetblue'
if location.pathname.startsWith('/moderations/')
# Marker with the proper icon
marker = L.AwesomeMarkers.icon
prefix: 'fa',
icon: 'calendar',
markerColor: 'cadetblue'
L.marker([coord[0], coord[1]], icon: marker).addTo map
$.getJSON url, (json) ->
layer = L.markerClusterGroup(maxClusterRadius: 30).addLayer L.geoJson json,
pointToLayer: (feature, latlng) ->
# Marker with the proper icon
marker = L.AwesomeMarkers.icon
prefix: 'fa',
icon: feature.properties.icon || 'calendar',
markerColor: markerColor
L.marker latlng, icon: marker
,
onEachFeature: (feature, layer) ->

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save