iag-geo / bootleaf

An open-source version of IAG's Bootleaf fork
https://demo.bootleaf.xyz
MIT License
89 stars 65 forks source link

Problem displaying basemap with MiniMap plugin #37

Open geoiva opened 3 years ago

geoiva commented 3 years ago

Good afternoon,

Thank you for the nice work! I am having a problem adding the MiniMap plugin control (https://github.com/Norkart/Leaflet-MiniMap). I followed the pattern in the code, and I have been able to add the MiniMap but I cannot see the basemap from the MiniMap. I get the following error: "There was a problem running the BeforeMapLoads custom code: Cannot read property 'on' of undefined". I added the control in the setBasemap Function:

function setBasemap(basemap){
    ......
    bootleaf.MiniMapControl = new L.Control.MiniMap(bootleaf.basemapLayer).addTo(bootleaf.map);
}

Any help on how can I do it? Thank you in advance.

Is there any guide or something I could follow?

image

slead commented 3 years ago

I haven't tried the minimap, but it looks cool. Are you able to share a link to your code (live site, or GitHub) so I can take a look? thanks

geoiva commented 3 years ago

Thank you for the quick reply.

You can see the code here: http://geoibol.com/bootleaf-iag-geo/

I tried two approaches: a) Line No 567 (app.js file). In the "Add map controls:" section, but basemap is not defined yer.

b) Line Nro 819 (app.js file), where the setBasemap function is...

Regards,

Ivar