Files
contao-leaflet-libraries/assets/leaflet-fullscreen/index.html

52 lines
1.9 KiB
HTML
Raw Normal View History

2015-01-20 16:03:59 +01:00
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Leaflet.Control.FullScreen Demo</title>
2016-10-04 13:50:43 +02:00
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
2015-01-20 16:03:59 +01:00
<style type="text/css">
#map { width: 700px; height: 433px; }
2015-10-30 23:48:21 +01:00
.fullscreen-icon { background-image: url(icon-fullscreen.png); }
2016-10-04 13:50:43 +02:00
/* one selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */
2015-01-20 16:03:59 +01:00
#map:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
2016-10-04 13:50:43 +02:00
#map:-ms-fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
2015-01-20 16:03:59 +01:00
#map:full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
2016-10-04 13:50:43 +02:00
#map:fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
2015-01-20 16:03:59 +01:00
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
</style>
2016-10-04 13:50:43 +02:00
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
2015-01-20 16:03:59 +01:00
<script src="Control.FullScreen.js"></script>
</head>
<body>
<div id="map"></div>
<script>
2015-10-30 23:48:21 +01:00
var base = new L.TileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
maxZoom: 19,
subdomains: 'abcd',
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
2015-01-20 16:03:59 +01:00
});
var map = new L.Map('map', {
layers: [base],
center: new L.LatLng(48.5, -4.5),
zoom: 5,
fullscreenControl: true,
fullscreenControlOptions: { // optional
2015-10-30 23:48:21 +01:00
title:"Show me the fullscreen !",
titleCancel:"Exit fullscreen mode"
2015-01-20 16:03:59 +01:00
}
});
// 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>
</body>
</html>