GithubHelp home page GithubHelp logo

Comments (9)

robpvn avatar robpvn commented on June 13, 2024

This seems like it could be a useful feature! Could you please provide a pull request where you have implemented the change along with a demo page to show off how you would use it in practice?

👍

from leaflet-minimap.

Coroico avatar Coroico commented on June 13, 2024

For the demo look at this page : http://bdvllrd.o2switch.net/eurovelo3/wpdev/tests/minimap-2.html
Change the map layer to see how the minimap change.

I am a leaflet newbie so may be this is not the better implementation:

map.on('baselayerchange', function(e) {
    // if needed update minimap
    if (e.name != iLayer){
        minimap.changeLayer(baseminimap[e.name]);
    }
    iLayer = e.name;
});

from leaflet-minimap.

hoge6b01 avatar hoge6b01 commented on June 13, 2024

Hello you two,

I've got a map with minimap code here: http://gis.stackexchange.com/questions/124996/minimap-in-leaflet/125111#125111

I've got some baselayers that I would like to see changing in Minimap as the baselayer changes.
But first problem is that minimap doesn't show a map at all.

Any suggestions how to fix that problem?
thanks a lot!

from leaflet-minimap.

robpvn avatar robpvn commented on June 13, 2024

@hoge6b01, I answered on the StackExchange post. Be a darling and accept the answer. ✔️

from leaflet-minimap.

hoge6b01 avatar hoge6b01 commented on June 13, 2024

@robpvn Thank you so much. I'll accept the answer.
What about the minimap showing the same baselayer as the real basemap?

from leaflet-minimap.

hoge6b01 avatar hoge6b01 commented on June 13, 2024

I tried Coroico's code but I am sure I did something wrong. All I got was a blank miniMap. Do you have any suggestions?
Thanks

from leaflet-minimap.

robpvn avatar robpvn commented on June 13, 2024

I don't have any suggestions when you don't give any details or show any code. Try making a JSFiddle with your code, remove everything that isn't related to your problem and showing us that. You might even fix the problem yourself while you do that work!

from leaflet-minimap.

hoge6b01 avatar hoge6b01 commented on June 13, 2024

Sorry, you're right. I updated the JSFiddle with my last code I tried to use. Would be great if you find any suggestion. http://jsfiddle.net/y4z9e9os/5/

from leaflet-minimap.

robpvn avatar robpvn commented on June 13, 2024

Your main problem was that @Coroico's code isn't in the plugin yet, so it needed to be added, secondly that you were using the other code wrong. I forked the fiddle and fixed it for you: http://jsfiddle.net/hk9f5dq0/

Now that I've taken the time to look at this properly, I might go ahead and add the relevant code into the plugin to make this easier in the future.

from leaflet-minimap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.