diff --git a/apps.json b/apps.json index f31a77243..697c78dc9 100644 --- a/apps.json +++ b/apps.json @@ -363,7 +363,7 @@ { "id": "gpsrec", "name": "GPS Recorder", "icon": "app.png", - "version":"0.13", + "version":"0.14", "interface": "interface.html", "description": "Application that allows you to record a GPS track. Can run in background", "tags": "tool,outdoors,gps,widget", @@ -942,12 +942,12 @@ ] }, { "id": "assistedgps", - "name": "Assisted GPS Update", + "name": "Assisted GPS Update (AGPS)", "icon": "app.png", "version":"0.01", "description": "Downloads assisted GPS data to Bangle.js for faster GPS startup and more accurate fixes", "custom": "custom.html", - "tags": "tool,outdoors", + "tags": "tool,outdoors,agps", "type": "RAM", "storage": [ ] }, @@ -1326,7 +1326,7 @@ "name": "OpenStreetMap", "shortName":"OpenStMap", "icon": "app.png", - "version":"0.03", + "version":"0.04", "description": "[BETA] Loads map tiles from OpenStreetMap onto your Bangle.js and displays a map of where you are", "tags": "outdoors,gps", "custom": "custom.html", @@ -2474,6 +2474,6 @@ "storage": [ {"name":"gmeter.app.js","url":"app.js"}, {"name":"gmeter.img","url":"app-icon.js","evaluate":true} - ] + ] } ] diff --git a/apps/gpsrec/ChangeLog b/apps/gpsrec/ChangeLog index 01788e08f..ddb7e7dc4 100644 --- a/apps/gpsrec/ChangeLog +++ b/apps/gpsrec/ChangeLog @@ -15,3 +15,4 @@ 0.12: Add option to plot on top of OpenStreetMap tiles (when they are installed on the watch) 0.13: Increase GPS recording accuracy by one decimal place Ensure default time period is 10 +0.14: Now use the openstmap lib for map plotting diff --git a/apps/gpsrec/app.js b/apps/gpsrec/app.js index c7de29d32..4fa51e3e1 100644 --- a/apps/gpsrec/app.js +++ b/apps/gpsrec/app.js @@ -2,7 +2,10 @@ Bangle.loadWidgets(); Bangle.drawWidgets(); var settings = require("Storage").readJSON("gpsrec.json",1)||{}; -var qOpenStMap = (require("Storage").list("openstmap.json")>0); +var osm; +try { // if it's installed, use the OpenStreetMap module + osm = require("openstmap"); +} catch (e) {} function getFN(n) { return ".gpsrc"+n.toString(36); @@ -134,7 +137,7 @@ function viewTrack(n, info) { info.qOSTM = false; plotTrack(info); }; - if (qOpenStMap) + if (osm) menu['Plot OpenStMap'] = function() { info.qOSTM = true; plotTrack(info); @@ -161,49 +164,22 @@ function viewTrack(n, info) { return E.showMenu(menu); } -function drawopenstmap(lat, lon, map) { - var s = require("Storage"); - var cx = g.getWidth()/2; - var cy = g.getHeight()/2; - var p = Bangle.project({lat:lat,lon:lon}); - var ix = (p.x-map.center.x)*4096/map.scale + (map.imgx/2) - cx; - var iy = (map.center.y-p.y)*4096/map.scale + (map.imgy/2) - cy; - var tx = 0|(ix/map.tilesize); - var ty = 0|(iy/map.tilesize); - var ox = (tx*map.tilesize)-ix; - var oy = (ty*map.tilesize)-iy; - for (var x=ox,ttx=tx;x