Specific marker color in moderation

This commit is contained in:
echarp 2016-05-22 01:23:17 +02:00
parent 6e112606bd
commit d46608823e
5 changed files with 75805 additions and 8 deletions

View File

@ -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
if location.pathname.startsWith('/moderations/')
# Marker with the proper icon
marker = L.AwesomeMarkers.icon
prefix: 'fa',
icon: 'calendar',
markerColor: 'cadetblue'
if location.pathname.startsWith('/moderations/')
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

File diff suppressed because one or more lines are too long