From d0b7a22e7bbd855ba150239b5f0df0bc8370dd81 Mon Sep 17 00:00:00 2001 From: Anton Sarukhanov <code@ant.sr> Date: Wed, 3 Feb 2016 20:21:21 -0500 Subject: [PATCH] Open vehicle popup when label is clicked --- static/js/map.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/js/map.js b/static/js/map.js index d8a1ecb..82af2b8 100644 --- a/static/js/map.js +++ b/static/js/map.js @@ -160,11 +160,15 @@ BusMap.Map = function(opts) { }).bindLabel(route, { noHide: true, direction: 'right', + clickable: true, }).bindPopup(text + text_after, popupOpts).addTo(that.vehicleMarkersGroup); } else { that.vehicleMarkers[v].setLatLng([vehicles[v].lat, vehicles[v].lon]) .setIconAngle(vehicles[v].heading); } + that.vehicleMarkers[v].label.on('click', function() { + this._source.openPopup(); + }); that.vehicleMarkers[v].bm_updated = Date.now() // Add predictions to the marker popup, if available -- GitLab