Skip to content

Instantly share code, notes, and snippets.

@nmandery
Created April 4, 2018 12:54
Show Gist options
  • Save nmandery/f3910806451a8303437f85fbc421c3bc to your computer and use it in GitHub Desktop.
Save nmandery/f3910806451a8303437f85fbc421c3bc to your computer and use it in GitHub Desktop.
EOC Bardabunga Volcano
<div id="info">&nbsp;</div>
<div id="map" class="map" style="width: 100%; height: 100%; position:fixed"></div>
var wmsSource = new ol.source.TileWMS({
url: "https://geoservice.dlr.de/eoc/zki/service/wms",
params: { LAYERS: "riesgos_workshop:volcano_holuhraun", TILED: true },
serverType: "geoserver",
crossOrigin: "anonymous"
});
var wmsLayer = new ol.layer.Tile({
source: wmsSource
});
var bg = new ol.layer.Tile({
visible: true,
opacity: 1.0,
title: "EOC Base Overlay",
source: new ol.source.WMTS({
attributions: [
new ol.Attribution({
html:
'| Baseoverlay: Data © <a href="http://openstreetmap.org">OpenStreetMap contributors</a> and <a href="../about#basemaps">others</a>, Rendering © <a href="http://www.dlr.de/eoc">DLR/EOC</a>'
})
],
url: "https://tiles.geoservice.dlr.de/service/wmts",
// crossOrigin: 'Anonymous',
layer: "eoc:baseoverlay",
matrixSet: "EPSG:3857",
format: "image/png",
projection: ol.proj.get("EPSG:3857"),
tileGrid: new ol.tilegrid.WMTS({
extent: [-20037508.3428, -20037508.3428, 20037508.3428, 20037508.3428],
origin: [-20037508.3428, 20037508.3428],
resolutions: [
156543.03392811998,
78271.51696419998,
39135.758481959994,
19567.879241008,
9783.939620504,
4891.969810252,
2445.984905126,
1222.9924525644,
611.4962262807999,
305.74811314039994,
152.87405657047998,
76.43702828523999,
38.21851414248,
19.109257071295996,
9.554628535647998,
4.777314267823999,
2.3886571339119995
],
matrixIds: [
"EPSG:3857:0",
"EPSG:3857:1",
"EPSG:3857:2",
"EPSG:3857:3",
"EPSG:3857:4",
"EPSG:3857:5",
"EPSG:3857:6",
"EPSG:3857:7",
"EPSG:3857:8",
"EPSG:3857:9",
"EPSG:3857:10",
"EPSG:3857:11",
"EPSG:3857:12",
"EPSG:3857:13",
"EPSG:3857:14",
"EPSG:3857:15",
"EPSG:3857:16"
],
tileSize: [256, 256]
}),
wrapX: true
})
});
var view = new ol.View({
center: [-1851547.9803089767, 9566623.303733895],
maxZoom: 19,
zoom: 11
});
var map = new ol.Map({
layers: [bg, wmsLayer],
target: document.getElementById("map"),
view: view
});
<script src="https://openlayers.org/en/v4.6.5/build/ol.js"></script>
<link href="https://openlayers.org/en/v4.6.5/css/ol.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment