1

I'm currently using Leaflet along with leaflet.fullscreen to provide a full screen map.

I've got it working nicely with the button but I can't work out how to "call" the function manually from my JavaScript code.

I've tried: map.fullscreenControl.toogleFullScreen(); but get the following error and a "broken" fullscreen:

TypeError: this.invalidateSize is not a function
this.invalidateSize();
  • Typo?? map.fullscreenControl.**toggleFullScreen**(); – Vic Mar 25 at 11:33
0

With no answers and still struggling I switched to a different plugin Leaflet.fullscreen .

It seems a lot more straightforward, however I did need to tweek the CSS for < IE9.

-1

You could trigger a click on its fullscreen button. For example with jQuery:

$(".leaflet-control-zoom-fullscreen")[0].click();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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