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 122 123 124 125 126 127 128 129 130 131 132 133 134 135
| <%@ page contentType="text/html;charset=utf-8" %>
<%@ include file="include.jsp" %>
<liferay-util:html-top>
</liferay-util:html-top>
<div id="GeoportalVisuDiv" style="width:600px"></div>
<img src="${context}/images/carte.png" style="width:600px" id="carte_fixe" usemap="#carte_fixe_map" alt="<spring:message code="carte-du-monde"/>">
<map name="carte_fixe_map">
<area shape="rect" coords="90,100,255,170" href="javascript:;" alt="Saint-Pierre et Miquelon" title="Saint-Pierre et Miquelon" onClick="afficheCarteDetail('SP');" />
<area shape="rect" coords="270,135,460,160" href="javascript:;" alt="France Métropolitaine et Corse" title="France Métropolitaine et Corse" onClick="afficheCarteDetail('FM');" />
<area shape="rect" coords="100,170,250,210" href="javascript:;" alt="Antilles et Guyanne" title="Antilles et Guyanne" onClick="afficheCarteDetail('AG');"/>
<area shape="rect" coords="60,215,150,250" href="javascript:;" alt="Clipperton" title="Clipperton" onClick="afficheCarteDetail('CL');"/>
<area shape="rect" coords="0,255,145,300" href="javascript:;" alt="Polynésie française" title="Polynésie française" onClick="afficheCarteDetail('PF');"/>
<area shape="rect" coords="345,274,450,315" href="javascript:;" alt="Océan indien" title="Océan indien" onClick="afficheCarteDetail('OI');"/>
<area shape="rect" coords="455,245,600,295" href="javascript:;" alt="Nouvelle-Calédonie" title="Nouvelle-Calédonie" onClick="afficheCarteDetail('NC');"/>
<area shape="rect" coords="455,300,600,315" href="javascript:;" alt="Wallis et Futuna" title="Wallis et Futuna" onClick="afficheCarteDetail('WF');"/>
<area shape="rect" coords="495,355,600,405" href="javascript:;" alt="Antarctique" title="Antarctique" onClick="afficheCarteDetail('AN');"/>
</map>
<!-- v=2.0-e -->
<script type="text/javascript" src="http://api.ign.fr/geoportail/api/js/2.0/GeoportalExtended.js" charset="utf-8">
<!--//--><![CDATA[//><!--
//--><!]]>
</script>
<!-- DEFINIR le chargeur de contrat : -->
<script type="text/javascript"><!--//--><![CDATA[//><!--
if (window.__Geoportal$timer===undefined) {
var __Geoportal$timer= null;
}
function checkApiLoading(retryClbk,clss) {
if (__Geoportal$timer!=null) {
//clearTimeout: annule le minuteur "__Geoportal$timer" avant sa fin
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() {
// on attend que les classes soient chargées
if (checkApiLoading(loadAPI,['OpenLayers','Geoportal','Geoportal.Viewer','Geoportal.Viewer.Default'])===false) {
return;
}
// on charge la configuration de la clef API, puis on charge l'application
Geoportal.GeoRMHandler.getConfig([${cleGeoportail}], null, null, {
onContractsComplete: afficheCarteDetail('FM')
});
}
//--><!]]></script>
<script type="text/javascript"><!--//--><![CDATA[//><!--
// la variable VISU n'est plus déclarée par l'API
VISU= null;
function afficheCarteDetail(zone)
{
document.getElementById('carte_fixe').style.display='none';
VISU= new Geoportal.Viewer.Default(
"GeoportalVisuDivDetail",
OpenLayers.Util.extend({
mode:"normal"},
gGEOPORTALRIGHTSMANAGEMENT || {})
);
if (VISU)
{
VISU.addGeoportalLayers();
VISU.setSize(600,600);
var markers = new OpenLayers.Layer.Markers( "Stations");
VISU.getMap().addLayer(markers);
var size = new OpenLayers.Size(21,25);
var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
var wgs84 = OpenLayers.Projection.CRS84;
var mapProj = VISU.getMap().getProjection();
<c:forEach var="station" items="${stations}">
<c:if test="${station.longitude!=null && station.latitude!=null}">
var icon${station.idStation} = new OpenLayers.Icon('${context}/images/icone_station_${station.etat}.png', size, offset);
var marker${station.idStation} = new OpenLayers.Marker(new OpenLayers.LonLat(${station.longitude},${station.latitude}).transform(wgs84,mapProj),icon${station.idStation});
marker${station.idStation}.events.register("click",marker${station.idStation},function() {document.location='/${station.friendlyUrl}';});
markers.addMarker(marker${station.idStation});
</c:if>
</c:forEach>
if(zone=='FM')
VISU.getMap().setCenterAtLonLat(1.9,47, 4);
else if(zone=='SP')
VISU.getMap().setCenterAtLonLat(-56.32,47.85, 4);
else if(zone=='AG')
VISU.getMap().setCenterAtLonLat(-61.5,11.03, 4);
else if(zone=='CL')
VISU.getMap().setCenterAtLonLat(-109.18,10.31, 4);
else if(zone=='PF')
VISU.getMap().setCenterAtLonLat(-149.566667,-17.533333, 3);
else if(zone=='OI')
VISU.getMap().setCenterAtLonLat(75.55,-26.67, 2);
else if(zone=='NC')
VISU.getMap().setCenterAtLonLat(166.45,-22.27, 4);
else if(zone=='WF')
VISU.getMap().setCenterAtLonLat(-176.17,-13.3, 4);
else if(zone=='AN')
VISU.getMap().setCenterAtLonLat(145.35,-57.10, 2);
}
}
}
</script>
<script type="text/javascript"><!--//--><![CDATA[//><!--
window.onload = loadAPI;
//--><!]]></script> |
Partager