Quelqu'un aurait-il la gentillesse de me faire parvenir un exemple simple d'API avec intégration de trace GPX, mon essai ne fonctionnant pas:
-le centrage fonctionne, mais pas le visu de ma trace; voici mon script
<!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">
<head>
<title>API Geoportail - TROIS SEIGNEURS</title>
<meta http-equiv="X-UA-Compatible" content="IE=7"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script
type="text/javascript"
src="http://api.ign.fr/geoportail/api?v=1.0beta4&key=XXXXXXXXXXXXXXXX&instance=TROISSEIGNEURS">
<!-- -->
</script>
<script type="text/javascript">
<!--
function initGeoportalMap() {
geoportalLoadTROISSEIGNEURS("GeoportalVisuDiv", "normal");
// Exemple avec un code territoire (ici la TROISSEIGNEURS)
// Snapshot with a territory code (here TROISSEIGNEURS)
// geoportalLoadVISU("GeoportalVisuDiv", "normal", "GLP");
TROISSEIGNEURS.getMap().setCenterAtLonLat("01° 24' 54\" E","42° 50' 54\" N",14);
if (TROISSEIGNEURS) {
TROISSEIGNEURS.addGeoportalLayers();
TROISSEIGNEURS.getMap().addLayer(
"GPX",
troisseigneurs.gpx,
"troisseigneurs.gpx",
options_gpx,
options_popup
);
}
}
-->
</script>
</head>
<body>
<div id="GeoportalVisuDiv" style="width:800px;height:600px;"></div>
</body>
</html>
![]()
Partager