Specific marker color in moderation
This commit is contained in:
parent
6e112606bd
commit
d46608823e
@ -53,23 +53,28 @@ $(document).ready ->
|
|||||||
).addTo map
|
).addTo map
|
||||||
|
|
||||||
url = $(this).data 'url'
|
url = $(this).data 'url'
|
||||||
|
markerColor = markerColors[idx++ %% markerColors.length]
|
||||||
if location.search && url.indexOf('?') >= 0
|
if location.search && url.indexOf('?') >= 0
|
||||||
url += '&' + location.search.substr 1
|
url += '&' + location.search.substr 1
|
||||||
else
|
else
|
||||||
url += location.search
|
url += location.search
|
||||||
|
|
||||||
|
if location.pathname.startsWith('/moderations/')
|
||||||
# Marker with the proper icon
|
# Marker with the proper icon
|
||||||
marker = L.AwesomeMarkers.icon
|
marker = L.AwesomeMarkers.icon
|
||||||
prefix: 'fa',
|
prefix: 'fa',
|
||||||
icon: 'calendar',
|
icon: 'calendar',
|
||||||
markerColor: 'cadetblue'
|
markerColor: 'cadetblue'
|
||||||
|
|
||||||
if location.pathname.startsWith('/moderations/')
|
|
||||||
L.marker([coord[0], coord[1]], icon: marker).addTo map
|
L.marker([coord[0], coord[1]], icon: marker).addTo map
|
||||||
|
|
||||||
$.getJSON url, (json) ->
|
$.getJSON url, (json) ->
|
||||||
layer = L.markerClusterGroup(maxClusterRadius: 30).addLayer L.geoJson json,
|
layer = L.markerClusterGroup(maxClusterRadius: 30).addLayer L.geoJson json,
|
||||||
pointToLayer: (feature, latlng) ->
|
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
|
L.marker latlng, icon: marker
|
||||||
,
|
,
|
||||||
onEachFeature: (feature, layer) ->
|
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
Binary file not shown.
Loading…
Reference in New Issue
Block a user