- var lonLat;
- // TODO: figure how to have multiple markers and/or track
- for (const loc of locations) {
- lonLat = new OpenLayers.LonLat(+loc.longitude,
- +loc.latitude).transform(
- new OpenLayers.Projection("EPSG:4326"),
- map.getProjectionObject());
- markers.addMarker(new OpenLayers.Marker(lonLat,icon));
+ // Draw a line between backlog locations
+ for (var i = 1; i < locations.length; i++) {
+ const p0 =
+ new OpenLayers.Geometry.Point(
+ locations[i-1].longitude,
+ locations[i-1].latitude)
+ .transform(new OpenLayers.Projection("EPSG:4326"),
+ map.getProjectionObject());
+ const p1 =
+ new OpenLayers.Geometry.Point(
+ locations[i].longitude,
+ locations[i].latitude)
+ .transform(new OpenLayers.Projection("EPSG:4326"),
+ map.getProjectionObject());
+ const leg =
+ new OpenLayers.Geometry.LineString([p0, p1]);
+ const lineFeature =
+ new OpenLayers.Feature.Vector(leg, null, lineStyle);
+ line.addFeatures([lineFeature]);
+