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
| <!DOCTYPE html>
<html lang="fr">
<head>
<title>Carte IGN avec ajout couche GPX</title>
<!-- Extension Géoportail pour OpenLayers 3 -->
<link rel="stylesheet" href="sdk-ol3/GpOl3.css" />
<script src="sdk-ol3/GpOl3.js"></script>
<!-- Surcharge de styles : -->
<style type="text/css">
<!--
/* Affichage de l'API Géoportail + image "loading" pendant le téléchargement */
div#map {
float:left;
background-image:url(http://capfrandos.free.fr/marcheura1.gif);
background-position:center 200px;
background-color:#ECFF9F;
background-repeat: no-repeat;
}
-->
</style>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<div align="center">
<table cellpadding="0" cellspacing="0" width="795">
<tr>
<td width="795">
<div id="map" style="width:800px;height:700px;"></div>
</td>
</tr>
<tr>
<td width="795">
<p align="center"><b><font face="Arial" color="blue" size="4">Tracé en bleu de notre randonnée " Du
village des Bories à Sénanque (84)"</font></b> <p align="center"><font face="Arial" color="blue" size="3">En
modifiant l' échelle, obtenez la carte IGN au 1/25000ème</font></p>
</b>
</td>
</tr>
</table>
</div>
<script>
var map = Gp.Map.load(
"map", // div html <div id="map">
{
// Votre clé de contrat
apiKey: "3folo8cdddf14usbl2th51ul",
// centre (ici en longitude / latitude, en EPSG:4326. Plus d'options ici : https://ignf.github.io/geoportal-sdk/latest/jsdoc/Gp.Center.html)
center : {
x : 5.1735,
y : 43.92648,
projection : "EPSG:4326"
},
// map zoom level
zoom : 14,
// Couches à afficher. Plus d'options ici : https://ignf.github.io/geoportal-sdk/latest/jsdoc/Gp.LayerOptions.html
layersOptions : {
// Photographies aériennes
"ORTHOIMAGERY.ORTHOPHOTOS" : {
opacity : 0.5
},
// Cartes IGN
"GEOGRAPHICALGRIDSYSTEMS.MAPS" : {
opacity : 1
},
"GPX1" :
{
format : "gpx", // format, obligatoire
title : "SENANQUE", // nom de votre gpx à afficher dans le gestionnaire de couches
url : "http://capfrandos.free.fr/senanquedefinitif.gpx", // Url vers votre fichier GPX
minZoom : 8,
maxZoom : 17,
styleOptions : {
strokeColor : "#0000ff",
strokeWidth : 8
}
},
},
// Contrôles additionnels (ici le gestionnaire de couches)
controlsOptions : {
"layerswitcher" : {
maximised : true
}
}
}
) ;
</script>
</body>
</html> |
Partager