function go() { var photosLyr = new ol.layer.GeoportalWMTS({ layer: "ORTHOIMAGERY.ORTHOPHOTOS" }) ; var roadsLyr = new ol.layer.GeoportalWMTS({ layer: "TRANSPORTS.DRONES.RESTRICTIONS" }) ; var map = new ol.Map({ target: 'map', layers: [ photosLyr, roadsLyr ], view: new ol.View({ center: [288074.8449901076, 6247982.515792289], zoom: 15 }) }); var getFeatureInfo = new ol.control.GetFeatureInfo({ layers : [ { obj : roadsLyr, infoFormat : "text/html", }, { obj : photosLyr, infoFormat : "text/html", }, ], options : { auto : true, active: true, defaultInfoFormat: "text/html", defaultEvent: "singleclick", cursorStyle: "pointer", } }); map.addControl(getFeatureInfo); var layerSwitcher = new ol.control.LayerSwitcher({}); map.addControl(layerSwitcher); } Gp.Services.getConfig({ apiKey: "essentiels,transports", onSuccess: go, onFailure: (e) => console.log(e) }); var infoDiv = document.getElementById("info"); infoDiv.innerHTML = "<p> Extension OL version " + Gp.olExtVersion + " (" + Gp.olExtDate + ")</p>";
<div id="map"></div> <div id="info"></div>
#map { padding: 5px; width: 100%; height: 600px; box-shadow: 0 0 10px #999; } #info { padding: 5px; width: 100%; height: 20px; font-family: "monospace"; font-size: 10px; }