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
| <script type="text/javascript">
<!--
function initGeoportalMap() {
gpxloaded = false ;
geoportalLoadVISU("GeoportalVisuDiv");
if (VISU) {
VISU.addGeoportalLayers( ['ORTHOIMAGERY.ORTHOPHOTOS:WMSC', 'GEOGRAPHICALGRIDSYSTEMS.MAPS:WMSC'],
{
'GEOGRAPHICALGRIDSYSTEMS.MAPS:WMSC':{visibility:true},global:{opacity:1},
'ORTHOIMAGERY.ORTHOPHOTOS:WMSC':{visibility:false},global:{opacity:1}
}
);
}
VISU.openLayersPanel(false);
VISU.openToolsPanel(false);
VISU.getMap().setCenter(VISU.viewerOptions.defaultCenter,VISU.viewerOptions.defaultZoom);
var gpx = VISU.getMap().addLayer("GPX","Itinéraire","<?= $path ?>", {
visibility:true,
zoomToExtent:true,
styleMap:new OpenLayers.StyleMap({
"default": new OpenLayers.Style(
OpenLayers.Util.applyDefaults({
fillColor: "#DD0000",
fillOpacity: 1,
strokeColor: "#DD0000",
strokeWidth: 4,
graphicZIndex: 1,
graphicName: "triangle",
pointRadius: 8,
label:"\${getName}",
labelAlign: "rb",
labelXOffset: -20,
labelYOffset: -20,
labelBackgroundColor: "#FFFF00",
labelBorderColor: "black",
labelBorderSize: "1px",
fontColor: "black",
fontWeight: "bold",
fontSize: "12px",
fontFamily: "Courier New, monospace"
},OpenLayers.Feature.Vector.style["default"]),{
context:{
getName: function(f) {
if (f.attributes['typeName']=='wpt') {
}
return '';
}
}
}),
"select": new OpenLayers.Style(
OpenLayers.Util.applyDefaults({
fillColor: "#FF9900",
fillOpacity: 0.75,
strokeColor: "#FFFF00",
strokeWidth: 4,
pointRadius: 12
},OpenLayers.Feature.Vector.style["select"]))
}),
eventListeners:{
"loadend":function(){
gpxloaded = true ;
addmarker() ;
if (this.maxExtent) {
this.map.zoomToExtent(this.maxExtent);
this.setVisibility(true);
}
}
}
}, {});
}
function addmarker() {
//construction du marqueur de depart
position = new OpenLayers.Geometry.Point(<?= $itineraire->wayPoints[0]->longitude?>, <?=$itineraire->wayPoints[0]->latitude?>);
position.transform(OpenLayers.Projection.CRS84, VISU.projection);
style = {externalGraphic:'<?= ASSETS_URL ?>/pics/marker.png', graphicWidth:24, graphicHeight:48, graphicZIndex: 20000};
pt = new OpenLayers.Feature.Vector(position, null, style);
//couche du marqueur
couche = new OpenLayers.Layer.Vector('Marqueurs');
couche.addFeatures([pt]);
VISU.getMap().addLayer(couche);
}
-->
</script> |
Partager