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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
<div id="Titre" align="center" class="Titre">Traitement Hélico de mars 2009<br>
</div>
<script type="text/javascript"
src="http://api.ign.fr/geoportail/api?v=1.0beta3&key=XXXXXXXXX&instance=map&">
</script>
<script type="text/javascript">
<!--
var nom;
map= null;// prevents IE errors when instance is not declared by the API
function surPoint(feature) {
if (feature) {
feature.style.externalGraphic= "icones/red-stars.png";
if (!feature.popup) {
var ll= feature.geometry.getBounds().getCenterLonLat();
feature.popup= new OpenLayers.Popup.FramedCloud(
"chicken",
ll,
null,
"<div style='font-size:.9em;color:#8080FF;font-weight:bold;background-color:#DCFFFF;'>" +
feature.attributes.name +
"</div><div style='font-size:.7em;'>" +
(feature.attributes.description? feature.attributes.description:"") +
"</div>",
null,
false);
}
if (feature.popup){
map.getMap().addPopup(feature.popup,true);
}
}
}
function quittePoint(feature) {
if (feature) {
feature.style.externalGraphic= "icones/blu-stars.png";
if (feature.popup){
feature.popup.destroy();
feature.popup=null;
}
}
}
function initGeoportalMap() {
OpenLayers.Util.onImageLoadErrorColor = "transparent";
map= OpenLayers.Util.Try(
function () {
geoportalLoadmap("MapDiv","normal","FXX");
return map;
},
function () {
OpenLayers.Console.error(Geoportal.i18n('new.instance.failed'));
return null;
}
);
if(map.allowedGeoportalLayers){
for (var i= 0; i<map.allowedGeoportalLayers.length; i++) {
var overloaded_options= null;
switch (map.allowedGeoportalLayers[i]) {
case 'GEOGRAPHICALGRIDSYSTEMS.MAPS': // cartes
overloaded_options= {
opacity: 1.0
};
break;
case 'ORTHOIMAGERY.ORTHOPHOTOS' : // ortho-photos
overloaded_options= {
visibility: false
};
break;
default :
break;
}
map.addGeoportalLayer(map.allowedGeoportalLayers[i],overloaded_options);
}
}
var pp_gpstm=map.addLayer(
"KML",
{
'pp_gpstm.kml.name':
{
'fr':"pts pose hélico"
}
},
"kml/pp_gpstm.kml",
{
visibility:true,
transparent:true,
opacity:1,
onFeatureInsert:function(f){}//default OL: on ne fait rien!
},
{
onSelect: surPoint,
onUnselect: quittePoint,
hover: true
}
);
map.setCenterAtLonLat(5.85,45.83,8);
} //fin de fonction initGeoportalMap
</script>
</head>
<body onload="initGeoportalMap();">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div id="MapDiv" style="width:800px;height:575px;"></div>
</body>
</html> |
Partager