I have an array in storage called track, it looks a bit like this.
[56.8967, 0.7654, 53,8736, 0.9832, 50,6453, 0,0773….etc]
As you can see, multiple lat and longs, the array is of no fixed size.
Currently I have only managed to draw the first lat lon in the array.
//By transforming them with this:
function TransformCoordinates(lat, lon) {
var Me = [240/2,240/2];
var track = Application.Storage.getValue(“track”);
var pixelsLong = (120 - lon) * (4/screenWidthPixels);
var pixelsLat = (lat - 120) * (4/screenHeightPixels);
var x = Me[1] - pixelsLong;
var y = Me[0] - pixelsLat;
return [x,y]; }
//Then drawing them with this:
function onUpdate(dc) {
var track = [x,y];
dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_TRANSPARENT);
for(var i=0; i<track.size();i=i+2){
var pointA=track[i];
var pointB=track[i+1];
dc.setPenWidth(8)
dc.drawPoint(pointA,pointB);}
Help in drawing all these points is much appreciated.


