shramov / leaflet-plugins

Plugins for Leaflet library
http://psha.org.ru/b/leaflet-plugins.html
MIT License
725 stars 288 forks source link

Permalink localStorage support? #221

Closed jblarsen closed 8 years ago

jblarsen commented 8 years ago

Hi

Permalink currently supports two methods for storing the state in the URL. These are in the query string (after the ?) and after the fragment identifier (#). These are great for web applications. An emerging standard for storing web applications on e.g. mobile phones and tablets is the Web App Manifest:

https://w3c.github.io/manifest/

which is already implemented in Android. This means that a web application can be "installed" on e.g. a mobile phone so that it looks more or less like an ordinary app.

The problem is that there is no support for storing state in the URL. But it is possible to store the state in localStorage instead. I therefore implemented support for this in a previous version of leaflet-plugins:

https://github.com/shramov/leaflet-plugins/compare/master...FCOO:master

My question is whether you would be interested in a pull request for the current version implementing this or you consider it outside the scope of your plugin? If you consider it outside the scope of your plugin we will probably just inherit your Permalink class and override the relevant methods so that we can easily update it.

A similar use case exists for iOS although Apple does not (yet) confirm to the Web App Manifest standard. For iOS you can also save the state in localStorage.

brunob commented 8 years ago

Hi @jblarsen and thanks for the proposal. Since the modification seems "small" feel free to send a pull request for that :)

brunob commented 8 years ago

@jblarsen any news about a pull request for that ?

jblarsen commented 8 years ago

Hi @brunob

I have made a pull request with the localStorage feature.

Best regards, Jesper

brunob commented 8 years ago

Closing since #225 was merged.