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