PR for #38 permalink#121
Conversation
|
All planned permalink features now implemented. Need to revisit layer handling when #113 is merged (async layer creation). |
|
So this was already there, only unit tests are lacking. The |
|
Should be good to go. |
| lConf.lid = now.getTime(); | ||
| // Make a unique layerId from Layer name and URL so contexts | ||
| // like permalinks can be reapplied. | ||
| lConf.lid = btoa(lConf.url + lConf.name).substr(0, 6); |
There was a problem hiding this comment.
Does every layer has a property url? Not sure about that
|
Looks good to me, thanks @justb4. One little question above and one general question: Will it be easily possible to apply another permalink structure? I have a public application called Shareloc, which provides shareable links for OpenLayers maps. In the future I might want to upgrade Shareloc to Wegue. The permalink in this PR looks a bit different from the one used with Shareloc (e.g. |
|
Not directly, though there is some abstraction already via the config: A next step would be to make all param-names configurable with sensible default. Not too difficult as parameter naming is just in a few places (2). Only |
Thanks for clarification. |
|
I just tested the Permlink behaviour and found something unexpected. If a layer gets activated it is not added to the permalink. Steps to reporduce:
|
|
Confirmed. As soon as you alter the Map View (pan, zoom) the Layer is added. Almost sure the problem is that changing active Layers does not trigger |
|
It is not intended that activating a layer triggers |
|
Yes, aware by now. Approach now (before seeing comment above) is to listen to two additional events: I will push the changes for now and make it WIP for review. |
… Layer Collection
|
Thanks for your ongoing work @justb4 ! LGTM, I'll merge now. |

This is a minimal permalink implementation, it is configuration-driven. Using a new
permalinkconfig object, example:Defaults apply, so
"permalink": {}is also valid.c(center),z(zoom) ,r(rotation) with optional prefixes e.g.map_c=.appCtx=are preservedpopstatecapturemap_z=1.9867&map_c=2.306,39.5258&map_r=0src/components/ol/PermalinkController.jsas ordinary classMap.vue/PermalinkController.jsapp-specific subclasses via Factory Method.PermalinkController.getParamStr ()) methodPermalinkController.getEmbedHTML ()) methodextentURL parameter i.s.o.center+zoom(configurable)lids?) to be encoded (challenge: layers are loadedasync)