Skip to content

leaflet.core: Add support for overview, pan, and large zoom controls (via plugins). - #258

Closed
ChALkeR wants to merge 2 commits into
mapstraction:release-2.1from
ChALkeR:leaflet-controls
Closed

ChALkeR wants to merge 2 commits into
mapstraction:release-2.1from
ChALkeR:leaflet-controls

Conversation

@ChALkeR

@ChALkeR ChALkeR commented Jun 17, 2013

Copy link
Copy Markdown

Add support for overview, pan, and large zoom controls in Leaflet.core using Control.MiniMap, Control.Zoomslider, and Control.Pan Leaflet plugins.

To use these controls, one has to load the corresponding plugins first.

These plugins are not official, but are listed on http://leafletjs.com/plugins.html "Notable Leaflet Plugins" page.

this.road_tile (and this.satellite_tile) were extended a bit for usage in the MiniMap.

If the plugins are not loaded, overview and pan are ignored, and large zoom falls back to small zoom, so nothing was broken (or even changed) in this case.

…using Control.MiniMap, Control.Zoomslider, and Control.Pan Leaflet plugins.

To use these controls, one has to load the corresponding plugins first.
These plugins are not official, but are listed on http://leafletjs.com/plugins.html "Notable Leaflet Plugins" page.
If the plugins are not loaded, overview and pan are ignored, and large zoom falls back to small zoom, so nothing changed in this case.
@gilesc50

Copy link
Copy Markdown
Member

What happens if you haven’t loaded the plugins?

Giles

From: Сковорода Никита Андреевич [mailto:notifications@github.com]
Sent: 17 June 2013 08:41
To: mapstraction/mxn
Subject: [mxn] leaflet.core: Add support for overview, pan, and large zoom controls (via plugins). (#258)

Add support for overview, pan, and large zoom controls in Leaflet.core using Control.MiniMap, Control.Zoomslider, and Control.Pan Leaflet plugins.

To use these controls, one has to load the corresponding plugins first.

These plugins are not official, but are listed on http://leafletjs.com/plugins.html "Notable Leaflet Plugins" page.

this.road_tile (and this.satellite_tile) were extended a bit for usage in the MiniMap.


You can merge this Pull Request by running

git pull https://github.com/ChALkeR/mxn leaflet-controls

Or view, comment on, or merge it at:

#258

Commit Summary

  • leaflet.core: Add support for overview, pan, and large zoom controls using Control.MiniMap, Control.Zoomslider, and Control.Pan Leaflet plugins.

File Changes

Patch Links:

@ChALkeR

ChALkeR commented Jun 17, 2013

Copy link
Copy Markdown
Author

As I wrote in the pull request description:

If the plugins are not loaded, overview and pan are ignored, and large zoom falls back to small zoom, so nothing was broken (or even changed) in this case.

@ChALkeR

ChALkeR commented Jun 17, 2013

Copy link
Copy Markdown
Author

A screenshot.
87

Note that I haven't updated the examples, so you have to add js/css files for plugins to see the change.

@ChALkeR

ChALkeR commented Jun 20, 2013

Copy link
Copy Markdown
Author

Can someone take a look on the pull requests, please?

@vicchi

vicchi commented Jun 20, 2013

Copy link
Copy Markdown
Member

I think we're all a bit maxed out in our day jobs at the moment; I'll take a look at soon as I can though that's probably going to be towards the end of the week.

@ChALkeR

ChALkeR commented Jun 20, 2013

Copy link
Copy Markdown
Author

Thank you =).

@ChALkeR

ChALkeR commented Jul 5, 2013

Copy link
Copy Markdown
Author

=)

@ChALkeR

ChALkeR commented Jul 23, 2013

Copy link
Copy Markdown
Author

Any news?

@gilesc50

Copy link
Copy Markdown
Member

waiting on issue #16 and #113 being worked on at the moment, then we'll work out how best to apply it to the plugins.

@ChALkeR

ChALkeR commented Aug 11, 2013

Copy link
Copy Markdown
Author

Umm. This pull request is not related to auto-loading of the map API scripts.

No auto-loading here, this code just uses Control.MiniMap, Control.Zoomslider, and Control.Pan if they are present (already loaded).

@gilesc50

Copy link
Copy Markdown
Member

yep and if they aren't we might autoload them :-)

@ChALkeR

ChALkeR commented Aug 11, 2013

Copy link
Copy Markdown
Author

From where?

@ChALkeR

ChALkeR commented Aug 11, 2013

Copy link
Copy Markdown
Author

I don't think that auto-loading of map API scripts is a great idea.

Various reasons:

  1. Map API keys.
  2. Other settings that are passed to the map API and that are not handeled by MXN (for example, language).
  3. Some Map APIs do not have a hosted version of the libraries that could be loaded, one has to host his own copy to use it. Are you going to include all such libraries in MXN?
  4. You will need to use the «current» channel for all the APIs (if available) or constantly update MXN on API version number changes (the link to the API scripts) to keep it actual, even if there are no changes in the MXN provider code.
  5. One that will use the auto-loading of the map API scripts will need to use the «current» channel (if available) or constanly update MXN to use the actual version of the map API, even if there are no changes in the MXN provider code.

@ChALkeR

ChALkeR commented Aug 11, 2013

Copy link
Copy Markdown
Author

Btw, these plugins are only hosted on Github, and you can't just load things from Github, afaik.
So no public hosted version of the API is available, one has to host his own.

One more note: self-hosted versions of the APIs that support self-hosting (openlayers, leaflet, etc) are more secure anyway.

@ChALkeR

ChALkeR commented Aug 11, 2013

Copy link
Copy Markdown
Author

@ChALkeR

ChALkeR commented Aug 11, 2013

Copy link
Copy Markdown
Author

One more question: is it really needed?
Are you going to use it? Is anyone going to use it?

@vicchi

vicchi commented Sep 7, 2013

Copy link
Copy Markdown
Member

As part of the work around Issue #113 and in supporting a whole set of constructor initialisation properties, I'm going to take a look at this now. The pull request as it stands may well not get merged in, as there's been a lot of under-the-hood changes, but support for these Leaflet plugins will be added.

@ChALkeR

ChALkeR commented Jan 9, 2014

Copy link
Copy Markdown
Author

Ok, there is one more issue with this pull request: the workaround at ChALkeR@5888b06#diff-fde6bd57f8f76f08905932effc9ebfe5R166 is not needed anymore with recent plugin versions.

Are the changes you were talking about finished?
What is the actual branch that should be used as a base for the updated pull request?

@ChALkeR

ChALkeR commented Jul 30, 2015

Copy link
Copy Markdown
Author

Hi all.

Mapstraction project seems stalled, so I ported my stuff away from it. I'm now using a thin abstraction layer of my own that supports only the minimal set of features that I need (map, controls, markers, geocoding) and only Leaflet/Google/Yandex as backends.

I will not update this pull request, so anyone who is interested is welcome to overtake it and notify me, so I will close this one. If you are an owner or a collaborator, you can just close this pull request without further notice when you feel like doing it.

@ChALkeR

ChALkeR commented Dec 12, 2015

Copy link
Copy Markdown
Author

Closing. Reopen if needed.

@ChALkeR ChALkeR closed this Dec 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants