-
Notifications
You must be signed in to change notification settings - Fork 5
/
FullScreen.html
33 lines (28 loc) · 1.34 KB
/
FullScreen.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<script src="https://unpkg.com/leaflet.fullscreen@latest/Control.FullScreen.js"></script>
<script type="text/javascript">
if(VRS && VRS.globalDispatch && VRS.serverConfig) {
VRS.globalDispatch.hook(VRS.globalEvent.bootstrapCreated, function (bootStrap) {
if (bootStrap.hookMapInitialised) {
bootStrap.hookMapInitialised(function (pageSettings) {
if (pageSettings.mapPlugin && pageSettings.mapPlugin.getNativeType() === 'OpenStreetMap') {
var map = pageSettings.mapPlugin.getNative();
// create fullscreen control
L.control.fullscreen({
position: 'topright', // change the position of the button can be topleft, topright, bottomright or bottomleft, default topleft
title: 'Show me the fullscreen !', // change the title of the button, default Full Screen
titleCancel: 'Exit fullscreen mode', // change the title of the button when fullscreen is on, default Exit Full Screen
}).addTo(map);
// add fullscreen control to the map
// detect fullscreen toggling
map.on('enterFullscreen', function(){
if(window.console) window.console.log('enterFullscreen');
});
map.on('exitFullscreen', function(){
if(window.console) window.console.log('exitFullscreen');
});
}
})
}
})
}
</script>