Support optional and custom layers in hash URL
- extend layer control to get current active layers (and more) - access layer control in hash instead of static initial list - use ',' layer separator and encode layers individually, so that comma in layer name gets encoded and is not mistaken as separator as with '-'
This commit is contained in:
parent
dbc7fce91d
commit
d83ffa3fbc
5 changed files with 101 additions and 74 deletions
|
|
@ -19,7 +19,6 @@
|
|||
function initApp(mapContext) {
|
||||
var map = mapContext.map,
|
||||
layersControl = mapContext.layersControl,
|
||||
mapLayers = mapContext.layers,
|
||||
search,
|
||||
router,
|
||||
routing,
|
||||
|
|
@ -311,9 +310,9 @@
|
|||
};
|
||||
urlHash.onHashChangeCb = onHashChangeCb;
|
||||
urlHash.onInvalidHashChangeCb = onInvalidHashChangeCb;
|
||||
urlHash.layers = mapLayers;
|
||||
urlHash.map = map;
|
||||
urlHash.init(map, mapLayers);
|
||||
urlHash.init(map, {
|
||||
layersControl: layersControl
|
||||
});
|
||||
|
||||
routingOptions.on('update', urlHash.onMapMove, urlHash);
|
||||
nogos.on('update', urlHash.onMapMove, urlHash);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue