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
|
<?php
header('Content-Type: text/html; charset=utf-8');
// --- Démarrage de session
session_start();
$rep_racine = "../../";
$rep_donnees = $rep_racine."donnees/";
$rep_topos = $rep_donnees."topos/";
$rep_topo = $rep_topos.(int)$_GET['id']."/";
$rep_gps = $rep_topo."gps/";
$gpx = $rep_gps.(int)$_GET['id'].".gpx";
if (file_exists($gpx))
{
?>
<!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" xml:lang="fr-FR" lang="fr-FR">
<head>
<title>Visualisation gpx</title>
<!-- IE8 compatibility mode -->
<!--[if IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=7"/>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="cache-control" content="no-cache" />
<script type="text/javascript" src="http://api.ign.fr/geoportail/api?v=1.0beta4&key=672250580210104975&instance=viewer&includeEngine=false&"><!-- --></script>
<script type="text/javascript" src="./geoportail/api/js/1.0beta5/GeoportalExtended.js"></script>
<script type="text/javascript">
<!--
// the viewer variable is declared by the API through the instance parameter
viewer = null;
var kbControl = null;
function initGeoportalMap()
{
if (typeof(geoportalLoadviewer) != 'function')
{
OpenLayers.Console.error(OpenLayers.i18n('new.instance.failed'));
return;
}
geoportalLoadviewer("viewerDiv", "normal", 'FXX', null, null, './geoportail/proxy.php' + '?url=');
viewer.addGeoportalLayers(['GEOGRAPHICALGRIDSYSTEMS.MAPS:WMSC']);
var style1 = new OpenLayers.StyleMap({
"default": new OpenLayers.Style({
strokeColor: '#0000ff',
strokeWidth: 3
}),
"select": new OpenLayers.Style({
strokeColor: '#3399ff',
strokeWidth: 3
})
});
viewer.setLayersPanelVisibility(false);
var gpx1 = viewer.getMap().addLayer("GPX", "gpx1", "<?php echo $gpx; ?>", {
styleMap: style1,
visibility: true,
minZoomLevel: 8,
maxZoomLevel: 14
},
{});
gpx1.events.register('loadend',gpx1, function(e){zoomToLyr();});
function zoomToLyr()
{
bounds = gpx1.features[0].geometry.getBounds();
viewer.getMap().zoomToExtent(bounds);
};
}
-->
</script>
</head>
<body onload="initGeoportalMap();">
<div id="viewerDiv" style="width:98%;height:98%;"></div>
</body>
</html>
<?php
}
?> |
Partager