I have implemented a minimap and I'm trying to hang a type click event to change the base layer. Like google maps.

But it does not work. This is my code:

_onBaselayerChanger: function (e) {
  var currentBaselayer = [];
  this._map.eachLayer(function(layer) {
      if( layer instanceof L.TileLayer )

Is there a plugin or something to help me?

1 Answer 1


There is not enough code in your post to get it testing (maybe you can create a simple fiddle?). However, in case you didn't run into those links before, here are examples that may be helpful for you to implement the action under your minimap click event:



To find minimap plugin google the names: L.Control.Layers.Minimap.js or Norkart/Leaflet-MiniMap.

  • yep, L.Control.Layers.Minimap.js is the excellent base! Thx
    – carlo
    Mar 4, 2017 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.