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
| <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.setInformationPanelVisibility(false) ;
VISU.getMap().setCenter(VISU.viewerOptions.defaultCenter,VISU.viewerOptions.defaultZoom);
var gpx = VISU.getMap().addLayer("GPX","Itinéraire","http://la-trace.com/itineraires/fileserve/4dd18e6370f2b.gpx", {
visibility:true,
styleMap:new OpenLayers.StyleMap({
"default": new OpenLayers.Style(
OpenLayers.Util.applyDefaults({
fillColor: "#DD0000",
fillOpacity: 1,
strokeColor: "#DD0000",
strokeWidth: 4,
graphicName: "",
pointRadius: 5,
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"]))
}),
rendererOptions: {
zIndexing: true
},
eventListeners:{
"loadend":function(){
gpxloaded = true ;
this.addmarker(gpx) ;
if (this.maxExtent) {
this.map.zoomToExtent(this.maxExtent);
}
}
},
addmarker: function() {
//construction du marqueur de depart
position = new OpenLayers.Geometry.Point(3.611429000000, 45.747104000000);
position.transform(OpenLayers.Projection.CRS84, VISU.projection);
style = {externalGraphic:'http://la-trace.com/assets/pics/marker.png', graphicWidth:24, graphicHeight:48};
pt = new OpenLayers.Feature.Vector(position, null, style);
//couche du marqueur
couche = new OpenLayers.Layer.Vector('Marqueurs');
couche.addFeatures([pt]);
VISU.getMap().addLayer(couche);
var zi= this.getZIndex();
this.setZIndex(couche.getZIndex());
couche.setZIndex(zi);
}
}, {});
}
-->
</script> |
Partager