I want to enable full screen mode, how is this possible? I want an option to expand in the top right corner if doable?
Thanks,
Sam
Hi @Samuel Cramphorn,Try to make it full screen by clicking something (a link or a button or a container), and inside the onclick, set the styling by using JavaScript. There are many ways to do this, but this is an example:
document.getElementById('idOfsomethingToBeClicked').setAttribute("style","height:100vh");Hope this helps.Regards,Alec
Thanks Alec,
I was hoping for something like this though, hoping it was built in...
https://leaflet.github.io/Leaflet.fullscreen/
I wanted to keep this component as pure as possible to make upgrading as easy as possible. So no, this would not be part of this component ever. Same goes for the draw extension where you can draw polygons and such on the map. Both can and should be delivered via other components.
Looking at that github it is very easy to add that to your application yourself. The mainpage of the github tells you everything your need to do to get things working.
Happy coding!
Vincent
Thanks Vincent for your haste response, appreciate that! I'm relatively new to OutSystems but wondering how I include the script & link in the same file? Are you able to give me an example of how I would add it?
There are two courses that go into detail on how to use javascript in OutSystems. I would recommend to check those. I have made the Leaflet component with the help of these two courses so I'm sure you would be able to do the same;
https://www.outsystems.com/training/courses/200/javascript-in-outsystems/
https://www.outsystems.com/training/courses/44/master-class-on-javascript-and-jquery/ (ignore the jquery part, it is deprecated in OutSystems UI and I would put no effort into it).
As for an example, just check out the Leaflet.Reactive component. Here you can see where I added the javascript of Leaflet. How I made sure it is loaded when the widget is used. How I interact with the L variable (created when loading the Leaflet javascript) and more. Your component should look a bit the same.
Greetings,