[TASK] Context menu/right click open layermenu

This commit is contained in:
Xaver Maierhofer 2016-05-22 16:36:14 +02:00
parent 5e93a5da68
commit b27ae7e8da

View File

@ -285,8 +285,8 @@ define(["map/clientlayer", "map/labelslayer",
} }
} }
function contextMenuGotoLocation(e) { function contextMenuOpenLayerMenu() {
router.gotoLocation(e.latlng); document.querySelector('.leaflet-control-layers').classList.add('leaflet-control-layers-expanded');
} }
var el = document.createElement("div"); var el = document.createElement("div");
@ -310,7 +310,7 @@ define(["map/clientlayer", "map/labelslayer",
map.on("locationfound", locationFound); map.on("locationfound", locationFound);
map.on("locationerror", locationError); map.on("locationerror", locationError);
map.on("dragend", saveView); map.on("dragend", saveView);
map.on("contextmenu", contextMenuGotoLocation); map.on("contextmenu", contextMenuOpenLayerMenu);
addButton(locateUserButton); addButton(locateUserButton);
addButton(showCoordsPickerButton); addButton(showCoordsPickerButton);