-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add map permalink functionality #38
Comments
We are looking into this in a project. I paste some comments here, as there are implementation options. First there is map basic context as in But the encoding is somewhat specific, would require specific parsing (of '/' separated) and one always needs a complete spec including Two real-world examples:
These also have sharing (buttons) options (link, embed iframe) possibly separate issue. I've implemented location hash before, example: One big disadvantage (over query params) I found (also in the OL example above) is that the browser back-button and history is "screwed up", i.e. goes through previous map-contexts i.s.o. previous web-page. (Or I missed something there). Maybe both options are possible as a config option when at least the permalink format is standardized, I propose: |
This sounds reasonable to me. Just one thought that I would like to add: What about using the map bounds instead of the map center? When using only the map center and zoom, the resulting map extend would be drastically different on different screen dimensions, like desktop and mobile (portrait oriented). Using the map extent as hash would enable us to show a targeted area fully covered, no matter what device opens the link. |
Ok, working on this... Yes, using extent i.s.o. zoom+center is an option. The WIP already uses a dedicated class This could also be a config option: which Map (View) parameters to manage: center+zoom or extent, layerIds and possibly app-specific. There's already some (optional) config options: param-prefix, projection (e.g. WGS84), |
An (more or less widely spread) app of mine also implements a kind of permalink protocol (which is its main purpose, see here): There I also decided against Regarding concrete params: I would start with the most common ones having in mind that we might have to extend the list of params in the future. |
Update: the "fill-up" of browser history is IMO independent on the use of The common use for the web is also that For layers my first thought is to use layer id's, as they should be unique (though sometimes Another requirement from our project is to use (I'll add my WIP as PR in moments). |
Another thought on |
… Layer Collection
Done in #121 |
Goal is to add a simple permalink functionality for the map state like it is done in http://openlayers.org/en/latest/examples/permalink.html
The text was updated successfully, but these errors were encountered: