Brought back Show/Hide markers functionality.
This commit is contained in:
parent
5b7d0eb12f
commit
328005ac4a
@ -2,7 +2,7 @@ class window.MarkerMgr
|
||||
constructor: (rpcclient) ->
|
||||
console.log 'MarkerMgr::constructor(%o)', rpcclient
|
||||
@rpcclient = rpcclient
|
||||
@show_markers = true
|
||||
@startstop_only = false
|
||||
@markers = {}
|
||||
@markers_old = {}
|
||||
@dateFrom = null
|
||||
@ -105,6 +105,8 @@ class window.MarkerMgr
|
||||
tooltip_txt = @getMarkerTooltip tidmarker
|
||||
icon_is_first = i is 0
|
||||
icon_is_last = i+1 is tidmarkers.length
|
||||
if @startstop_only and not (icon_is_first or icon_is_last)
|
||||
continue
|
||||
icon = @getMarkerIcon tid, icon_is_first, icon_is_last
|
||||
marker = L.marker [tidmarker.latitude, tidmarker.longitude], {icon: icon}
|
||||
.bindPopup tooltip_txt
|
||||
|
@ -88,11 +88,13 @@ class window.OwnMap
|
||||
|
||||
showMarkers: ->
|
||||
console.log 'OwnMap::showMarkers()'
|
||||
# TODO: Use MarkerMgr (needs to be implemented there first)
|
||||
@markermgr.startstop_only = false
|
||||
@drawMap()
|
||||
|
||||
hideMarkers: ->
|
||||
console.log 'OwnMap::hideMarkers()'
|
||||
# TODO: Use MarkerMgr (needs to be implemented there first)
|
||||
@markermgr.startstop_only = true
|
||||
@drawMap()
|
||||
|
||||
resetZoom: ->
|
||||
console.log 'OwnMap::resetZoom()'
|
||||
|
Reference in New Issue
Block a user