[CHIE] - Cache WMTS - [Wiki] Mapea 4 - WMTS
by SIGC GUADALTEL
HTML
<script src="https://mapea4-sigc.juntadeandalucia.es/js/mapea-5.1.0.ol.min.js"></script>
<link rel="stylesheet" href="https://mapea4-sigc.juntadeandalucia.es/assets/css/mapea-5.1.0.ol.min.css">
<script src="https://mapea4-sigc.juntadeandalucia.es/js/configuration-5.1.0.js"></script>
<div id="map"></div>
CSS
html,
body,
#map {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
}
JavaScript
let layer1 = new M.layer.WMTS({
url: "http://www.ideandalucia.es/geowebcache/service/wmts",
name: "toporaster",
matrixSet: "EPSG:25830",
legend: "Toporaster"
});
let capabilitiesGeneral = layer1.getCapabilities();
mapajs = M.map({
container: "map",
layers: [layer1],
center: [363063, 4150610],
zoom: '4',
controls: ['layerswitcher']
});
// Capaa pedir del mismo Servidor WMTS
let layer2 = new M.layer.WMTS({
url: "http://www.ideandalucia.es/geowebcache/service/wmts",
name: "orto_2010-11",
matrixSet: "EPSG:25830",
legend: "orto_2010-11"
});
layer2.getImpl().getCapabilitiesPromise_ = capabilitiesGeneral;
mapajs.addWMTS(layer2);