commit c5081b1b757779a30c5d3ef30080259cdb7251f9 parent a8726256cc5b198d9539bdb2a679b96e3fda62fb Author: Sergej Orlov <wladimirych@gmail.com> Date: Tue, 7 Mar 2017 02:11:58 +0300 [panoramas] avoid errors when user presses enter Diffstat:
M | src/lib/leaflet.control.panoramas/index.js | | | 5 | ++++- |
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/lib/leaflet.control.panoramas/index.js b/src/lib/leaflet.control.panoramas/index.js @@ -89,7 +89,10 @@ L.Control.Panoramas = L.Control.extend({ }, onMapClick: function(e) { - this.showPanoramaAtPos(e.latlng); + // click event on map can be from keypress with keycode=13 in which case it doesnot have position + if (e.latlng) { + this.showPanoramaAtPos(e.latlng); + } }, showPanoramaAtPos: function(latlng, pov) {