lespetitshackers:ffox:cartegps
Différences
Ci-dessous, les différences entre deux révisions de la page.
| lespetitshackers:ffox:cartegps [2013/06/08 17:53] – créée christian.jacolot | lespetitshackers:ffox:cartegps [2024/04/16 22:26] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | ====== Exemple Carte GPS non dynamique- Firefox OS ====== | ||
| + | |||
| + | ===== Création de l' | ||
| + | |||
| + | Créer un dossier //gps// qui contiendra tout les scripts de votre application. | ||
| + | |||
| + | Fichier index.html : | ||
| + | < | ||
| + | < | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <link rel=" | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | < | ||
| + | <div id=" | ||
| + | overflow: hidden; box-shadow: 0px 0px 5px gray; text-align: center;"> | ||
| + | </ | ||
| + | |||
| + | <p> | ||
| + | <script type=" | ||
| + | <script type=" | ||
| + | var map; | ||
| + | function init_map(lat, | ||
| + | /* map obj */ | ||
| + | map = new OpenLayers.Map(' | ||
| + | /* Adding OSM layer */ | ||
| + | map.addLayer( new OpenLayers.Layer.OSM() ); | ||
| + | /* Centering map */ | ||
| + | var localLocation = new OpenLayers.LonLat(lon, | ||
| + | map.setCenter(localLocation); | ||
| + | map.zoomTo(17); | ||
| + | } | ||
| + | |||
| + | function geo_success(position) { | ||
| + | init_map(position.coords.latitude, | ||
| + | } | ||
| + | |||
| + | navigator.geolocation.watchPosition(geo_success); | ||
| + | </ | ||
| + | |||
| + | </p> | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Fichier de l' | ||
| + | {{: | ||
| + | |||
| + | |||
| + | Création d'un fichier manifest.webapp : | ||
| + | < | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
