1
0

Brought back Show/Hide markers functionality.

This commit is contained in:
Markus Birth 2018-06-03 16:43:56 +02:00
parent 5b7d0eb12f
commit 328005ac4a
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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()'