function go() { var cartesLyr = new ol.layer.GeoportalWMTS({ layer: "GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2", }) ; var map = new ol.Map({ target: 'map', layers: [ cartesLyr ], view: new ol.View({ center: [288074.8449901076, 6247982.515792289], zoom: 12 }) }); var searchControl = new ol.control.SearchEngine({ // additionnal options may be specified here }); map.addControl(searchControl); } Gp.Services.getConfig({ apiKey: "essentiels", onSuccess: go }); 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; }