2013-06-28 21:55:17 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Leaflet debug page</title>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
|
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../css/screen.css" />
|
|
|
|
|
|
|
|
<script src="../leaflet-include.js"></script>
|
|
|
|
<style>
|
|
|
|
.mapcontainer {
|
2016-04-29 17:35:50 +08:00
|
|
|
float:left;
|
|
|
|
position: relative;
|
|
|
|
width: 32%;
|
|
|
|
font-size: 12px;
|
|
|
|
font-family: sans-serif;
|
|
|
|
height: 340px;
|
|
|
|
margin-bottom: 15px;
|
|
|
|
background-color: #eee;
|
|
|
|
margin-right: 1%;
|
2013-06-28 21:55:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.map {
|
2016-04-29 17:35:50 +08:00
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 280px;
|
|
|
|
bottom: 0px;
|
2013-06-28 21:55:17 +08:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p>These should all render identically.</p>
|
|
|
|
<div class="mapcontainer">
|
|
|
|
CASE 1: no opacity set on any layers
|
|
|
|
<br />
|
|
|
|
<div id="map1" class="map"></div>
|
|
|
|
</div>
|
|
|
|
<div class="mapcontainer">
|
|
|
|
CASE 2: opacity set to .99 on overlays but not on basemap
|
|
|
|
<br />
|
|
|
|
<div id="map2" class="map"></div>
|
|
|
|
</div>
|
|
|
|
<div class="mapcontainer">
|
|
|
|
CASE 3: opacity set on overlays but not on basemap, zIndex option set to 0 on basemap
|
|
|
|
<br />
|
|
|
|
<div id="map3" class="map"></div>
|
|
|
|
</div>
|
|
|
|
<div class="mapcontainer">
|
|
|
|
CASE 4: opacity set to .99 on overlays but set to 1 on basemap
|
|
|
|
<br />
|
|
|
|
<div id="map4" class="map"></div>
|
|
|
|
</div>
|
|
|
|
<div class="mapcontainer">
|
|
|
|
CASE 5: opacity set to .99 on all layers
|
|
|
|
<br />
|
|
|
|
<div id="map5" class="map"></div>
|
|
|
|
</div>
|
|
|
|
<div class="mapcontainer">
|
|
|
|
CASE 6: opacity set to .99 on 1st and 3rd layers and 1 on middle layer
|
|
|
|
<br />
|
|
|
|
<div id="map6" class="map"></div>
|
|
|
|
</div>
|
|
|
|
|
2017-02-04 23:17:51 +08:00
|
|
|
<script>
|
2013-06-28 21:55:17 +08:00
|
|
|
var mapopts = {
|
2016-04-29 17:35:50 +08:00
|
|
|
center: [35, -122],
|
|
|
|
zoom : 5
|
2013-06-28 21:55:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
var map1 = L.map('map1', mapopts);
|
|
|
|
var map2 = L.map('map2', mapopts);
|
|
|
|
var map3 = L.map('map3', mapopts);
|
|
|
|
var map4 = L.map('map4', mapopts);
|
|
|
|
var map5 = L.map('map5', mapopts);
|
|
|
|
var map6 = L.map('map6', mapopts);
|
|
|
|
|
|
|
|
/**********
|
|
|
|
CASE 1: no opacity set on any layers
|
|
|
|
**********/
|
|
|
|
// OSM Basemap
|
2018-03-12 15:46:20 +08:00
|
|
|
var osmUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
|
|
osmAttrib = '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
|
2014-03-04 23:54:41 +08:00
|
|
|
|
|
|
|
var osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: ''}).addTo(map1);
|
2013-06-28 21:55:17 +08:00
|
|
|
|
|
|
|
// EEZs / Nations
|
2016-04-25 14:43:01 +08:00
|
|
|
var eez1 = L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: true
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map1);
|
|
|
|
|
|
|
|
// Marine Protected Areas overlay
|
2016-04-25 14:43:01 +08:00
|
|
|
var mpa1 = L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: false
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map1);
|
|
|
|
|
|
|
|
|
|
|
|
/**********
|
|
|
|
CASE 2: opacity set on overlays but not on basemap
|
|
|
|
**********/
|
|
|
|
// OSM Basemap
|
2014-03-04 23:54:41 +08:00
|
|
|
var osm2 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: ''}).addTo(map2);
|
2013-06-28 21:55:17 +08:00
|
|
|
|
|
|
|
// EEZs / Nations
|
2016-04-25 14:43:01 +08:00
|
|
|
var eez2 = L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: true,
|
|
|
|
opacity: 0.99
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map2);
|
|
|
|
|
|
|
|
// Marine Protected Areas overlay
|
2016-04-25 14:43:01 +08:00
|
|
|
var mpa2 = L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: false,
|
|
|
|
opacity: 0.99
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map2);
|
|
|
|
|
|
|
|
|
|
|
|
/**********
|
|
|
|
CASE 3: opacity set on overlays but not on basemap, zIndex option set to 0 on basemap
|
|
|
|
**********/
|
|
|
|
// OSM Basemap
|
2014-03-04 23:54:41 +08:00
|
|
|
var osm3 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: '', zIndex: 0}).addTo(map3);
|
2013-06-28 21:55:17 +08:00
|
|
|
|
|
|
|
// EEZs / Nations
|
2016-04-25 14:43:01 +08:00
|
|
|
var eez3 = L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: true,
|
|
|
|
opacity: 0.99
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map3);
|
|
|
|
|
|
|
|
// Marine Protected Areas overlay
|
2016-04-25 14:43:01 +08:00
|
|
|
var mpa3 = L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: false,
|
|
|
|
opacity: 0.99
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map3);
|
|
|
|
|
|
|
|
|
|
|
|
/**********
|
|
|
|
CASE 4: opacity set on overlays but set to 1 on basemap
|
|
|
|
**********/
|
|
|
|
// OSM Basemap
|
2014-03-04 23:54:41 +08:00
|
|
|
var osm4 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}).addTo(map4);
|
2013-06-28 21:55:17 +08:00
|
|
|
|
|
|
|
// EEZs / Nations
|
2016-04-25 14:43:01 +08:00
|
|
|
var eez4 = L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: true,
|
|
|
|
opacity: 0.99
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map4);
|
|
|
|
|
|
|
|
// Marine Protected Areas overlay
|
2016-04-25 14:43:01 +08:00
|
|
|
var mpa4 = L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: false,
|
|
|
|
opacity: 0.99
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map4);
|
|
|
|
|
|
|
|
|
|
|
|
/**********
|
|
|
|
CASE 5: opacity set to .5 on all layers
|
|
|
|
**********/
|
|
|
|
// OSM Basemap
|
2014-03-04 23:54:41 +08:00
|
|
|
var osm5 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: '', opacity: 0.99}).addTo(map5);
|
2013-06-28 21:55:17 +08:00
|
|
|
|
|
|
|
// EEZs / Nations
|
2016-04-25 14:43:01 +08:00
|
|
|
var eez5 = L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: true,
|
|
|
|
opacity: 0.99
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map5);
|
|
|
|
|
|
|
|
// Marine Protected Areas overlay
|
2016-04-25 14:43:01 +08:00
|
|
|
var mpa5 = L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: false,
|
|
|
|
opacity: 0.99
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map5);
|
|
|
|
|
|
|
|
|
|
|
|
/**********
|
|
|
|
CASE 6: opacity set to .5 on 1st and 3rd layers and 1 on middle layer
|
|
|
|
**********/
|
|
|
|
// OSM Basemap
|
2014-03-04 23:54:41 +08:00
|
|
|
var osm6 = L.tileLayer(osmUrl, {maxZoom: 18, attribution: '', opacity: 0.99}).addTo(map6);
|
2013-06-28 21:55:17 +08:00
|
|
|
|
|
|
|
// EEZs / Nations
|
2016-04-25 14:43:01 +08:00
|
|
|
var eez6 = L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: true,
|
|
|
|
opacity: 1
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map6);
|
|
|
|
|
|
|
|
// Marine Protected Areas overlay
|
2016-04-25 14:43:01 +08:00
|
|
|
var mpa6 = L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
|
2016-04-29 17:35:50 +08:00
|
|
|
tms: false,
|
|
|
|
opacity: 0.99
|
2013-06-28 21:55:17 +08:00
|
|
|
}).addTo(map6);
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|