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

miniMap.removeFrom(map) && miniMap.addTo(map) #7

Closed
apuntovanini opened this issue Dec 6, 2012 · 5 comments
Closed

miniMap.removeFrom(map) && miniMap.addTo(map) #7

apuntovanini opened this issue Dec 6, 2012 · 5 comments
Assignees
Labels

Comments

@apuntovanini
Copy link

Hi there!
Is there a way to re-initialize minimap after first time loading?
I have a simple toggle, that shows and hide miniMap. I tried to do so by adding and removing miniMap to and from the main map. It seems it's not working however after the first hide/show cycle!
I may be missing something, could you help me out?

Thanks for the great work!
Andrea

@robpvn
Copy link
Contributor

robpvn commented Dec 8, 2012

You know, I've never actually tried doing that. It's quite probable something is wrong with the method for removing it from the map. I'll investigate!

@ghost ghost assigned robpvn Dec 8, 2012
@robpvn robpvn closed this as completed in 6afda20 Dec 10, 2012
@apuntovanini
Copy link
Author

It works perfectly now! Thank you very much!

@brunob
Copy link

brunob commented Feb 18, 2013

Hi @robpvn i've got a small problem with the L.Util.clone() method added here when i'm using leaflet providers plugin. I describe this bug here : https://github.com/seelmann/leaflet-providers/pull/6#issuecomment-13719902

I'm not sure if the bug should be fixed in leaflet providers or in the clone() method of leaflet minimap...

@robpvn
Copy link
Contributor

robpvn commented Feb 22, 2013

There's an error in your example: You reused defaultLayer in the minimap after you added it to the main map. Like it says in the readme and examples, you can't do that because the layer object will already have been initialised by the main map. I checked and fixing that still doesn't fix the problem though. 👎

I opened a new issue, #15 , to deal with this.

@brunob
Copy link

brunob commented Feb 22, 2013

Hi @robpvn good point i've wrote this example without taking car of creating a new layer for the minimap, but in myreal implementation i'm creating a new layer for it and like you see it fails too :( I'll post un updated example on #15

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

No branches or pull requests

3 participants