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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<div id="GeoportalMapDiv" style="height:500px;width:750px;"></div>
<script type="text/javascript" charset="utf-8" src="http://api.ign.fr/geoportail/api/js/2.0.0/GeoportalExtended.js">
</script>
<script type="text/javascript">
var viewer = null;
if (window.__Geoportal$timer===undefined) {
var __Geoportal$timer= null;
}
function checkApiLoading(retryClbk,clss) {
if (__Geoportal$timer!=null) {
window.clearTimeout(__Geoportal$timer);
__Geoportal$timer= null;
}
/**
* Il se peut que l'init soit exécuté avant que l'API ne soit chargée
* Ajout d'un code temporisateur qui attend 300 ms avant de relancer l'init
*/
var f;
for (var i=0, l= clss.length; i<l; i++) {
try {
f= eval(clss[i]);
} catch (e) {
f= undefined;
}
if (typeof(f)==='undefined') {
__Geoportal$timer= window.setTimeout(retryClbk, 300);
return false;
}
}
return true;
}
function loadAPI() {
if (checkApiLoading(loadAPI,['OpenLayers','Geoportal','Geoportal.Viewer','Geoportal.Viewer.Default'])===false) {
return;
}
Geoportal.GeoRMHandler.getConfig(['emr9v89klibygsu2wse5j8o5'], null, null, {
onContractsComplete: initGeoportalMap
});
}
function initGeoportalMap() {
viewer = new Geoportal.Viewer.Default(
"GeoportalMapDiv",
OpenLayers.Util.extend({
mode:'normal',
nameInstance:'viewer',
},
gGEOPORTALRIGHTSMANAGEMENT
));
viewer.addGeoportalLayers(['ORTHOIMAGERY.ORTHOPHOTOS',
'GEOGRAPHICALGRIDSYSTEMS.MAPS']);
}
window.onload= loadAPI;
</script>
</body>
</html> |
Partager