forked from sopac/cifdp-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
baselayers.js
41 lines (38 loc) · 1.29 KB
/
baselayers.js
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
34
35
36
37
38
39
40
41
/*
* Return common layers used in different examples
*/
function getCommonBaseLayers(map){
var BING_KEY = 'AuhiCJHlGzhg93IqUH_oCpl_-ZUrIE6SPftlyGYUvr9Amx5nzA-WqGcPquyFZl4L';
//var bingLayer = L.tileLayer.bing(BING_KEY, {
// imagerySet:'AerialWithLabels'
//});
var bingLayer = L.tileLayer.bing({
bingMapsKey: BING_KEY,
imagerySet: 'AerialWithLabels'
});
var osmLayer = L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© Pacific Community (OSM)'
});
var bathymetryLayer = L.tileLayer.wms("https://ows.emodnet-bathymetry.eu/wms", {
layers: 'emodnet:mean_atlas_land',
format: 'image/png',
transparent: true,
attribution: "EMODnet Bathymetry",
opacity: 0.8
});
var coastlinesLayer = L.tileLayer.wms("https://ows.emodnet-bathymetry.eu/wms", {
layers: 'coastlines',
format: 'image/png',
transparent: true,
attribution: "EMODnet Bathymetry",
opacity: 0.8
});
var bathymetryGroupLayer = L.layerGroup([bathymetryLayer, coastlinesLayer]);
//bathymetryGroupLayer.addTo(map);
osmLayer.addTo(map);
return {
"OSM": osmLayer,
"Bing": bingLayer,
"EMODnet Bathymetry": bathymetryGroupLayer
};
}