Closed hairman closed 2 years ago
Does the example file works from your side ? Can you share a link to your code online in order to help you ?
Thanks for the help. My test page. https://cto.softmax.by/map_test_fs/
Ok, i see as stated in https://github.com/Leaflet/Leaflet.fullscreen/issues/28#issuecomment-50845790 and here https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen
Note: This method must be called while responding to a user interaction or a device orientation change; otherwise it will fail.
You can't call toggleFullScreen()
directly, maybe i should add a not about this in the readme ?
ОК. What is meant by "while responding to a user interaction"? I added a button to call a function and that doesn't work either.
test page updated
I need to toggle FullScreen from an external function. How to do it right? Thanks.
Please see this implementation. A similar method works there.
Haaa my bad, toggleFullscreen != toggleFullScreen cf https://github.com/brunob/leaflet.fullscreen/blob/master/Control.FullScreen.js#L322
I'll fix the readme on this point :)
Hello. Please tell me what am I doing wrong.
The button on the map is added and it works. But I am getting an error:
Uncaught TypeError: map.toggleFullScreen is not a function
Tested on leaflet version 1.7.1 and 1.8.0