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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>API Geoportail - votre carte personnelle</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="http://api.ign.fr/geoportail/api?v=1.2&key=XXXXXXXXXXXXXXXXXXXX&instance=vanoise"></script>
<script type="text/javascript">
function initGeoportalMap() {
var language= OpenLayers.Lang.getCode();
var re= new RegExp("^"+language);
geoportalLoadvanoise("GeoportalMapDiv", "normal", "FXX");
if(vanoise.allowedGeoportalLayers){
for (var i= 0; i<vanoise.allowedGeoportalLayers.length; i++) {
var overloaded_options= null;
switch (vanoise.allowedGeoportalLayers[i]) {
case 'GEOGRAPHICALGRIDSYSTEMS.MAPS': // cartes
overloaded_options= {
visibility: false,
opacity:0.8
};
break;
case 'ORTHOIMAGERY.ORTHOPHOTOS' : // ortho-photos
overloaded_options= {
visibility: true
};
break;
default :
break;
}
vanoise.addGeoportalLayer(vanoise.allowedGeoportalLayers[i],overloaded_options);
}
}
//Ajout d'une couche KML : le vanoise
vanoise.addLayer("KML",
{'vanoise_layer.kml.name':
{
'en':"Vanoise National Park",
'fr':"Parc National de la Vanoise",
'ja':"ヴァノワーズ国立公園"
}},
"vanoise.kml",
{
visibility:true
}
);
var geometry= new OpenLayers.Geometry.Point(6.551,45.164);
geometry.transform(new OpenLayers.Projection('IGNF:RGF93G'), vanoise.getProjection());
vanoise.setCenter(geometry.x,geometry.y,6);
}
</script>
</head>
<body>
<div id="GeoportalMapDiv" style="width:400px;height:400px;"></div>
</body>
</html> |
Partager