Skip to content
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

Update Leaflet to 1.7.1 and make the map global accessible #2

Open
Falke-Design opened this issue Dec 9, 2021 · 0 comments
Open

Update Leaflet to 1.7.1 and make the map global accessible #2

Falke-Design opened this issue Dec 9, 2021 · 0 comments

Comments

@Falke-Design
Copy link

Hi,

I'm coming from SO because of this post. While I digging into the problem, I saw that your plugin uses a very old version of Leaflet. The newest release is 1.7.1 and you are using 0.7.3 from the year 2013.
I recommand to update Leaflet there are many issues fixed since them and compatibility for mobile divces is now much better.

Also I suggest to add an option, so that the developer can decide if the map variable of the script leaflet-filters is added to the window object (which makes it global accessible). This would make it possible that the user can add own Leaflet layers / logic to the map.

The following line after this.map=L.map(this.params["map-container"],options); would be enough:

window.map = this.map;

this.createMap=function() {
var self=this;
var options={
"center": new L.latLng(this.params["initial-lat"],this.params["initial-lon"]),
"maxZoom":this.params["overlay"]["maxZoom"],
"minZoom":this.params["overlay"]["minZoom"],
"scrollWheelZoom":this.params["scrollWheelZoom"],
"worldCopyJump" : true
};
this.map=L.map(this.params["map-container"],options);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant