From 05d052fb000b6455a5a876378c3cd43db2ef3a00 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Sun, 22 May 2016 10:39:09 +0200 Subject: [PATCH] Added markers on map for beginning and end --- .../estraba/controller/DashboardController.java | 12 +++++++++++- src/main/resources/general.properties | 2 ++ src/main/resources/general_ca.properties | 2 ++ src/main/resources/general_es.properties | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/es/kauron/estraba/controller/DashboardController.java b/src/main/java/es/kauron/estraba/controller/DashboardController.java index d2cb440..aad4c7c 100644 --- a/src/main/java/es/kauron/estraba/controller/DashboardController.java +++ b/src/main/java/es/kauron/estraba/controller/DashboardController.java @@ -129,7 +129,7 @@ public class DashboardController implements Initializable, MapComponentInitializ return App.GENERAL_BUNDLE.getString("label.welcome"); } - public void load(DataBundle bundle) { + void load(DataBundle bundle) { valueHRAvg.setText(bundle.HRAvg); valueHRMax.setText(bundle.HRMax); valueHRMin.setText(bundle.HRMin); @@ -200,7 +200,17 @@ public class DashboardController implements Initializable, MapComponentInitializ // This polyline displays instantly with no problem // TODO: add color with PolylineOptions.strokeColor("#ffff00") to match the color schemes of the app // When using that method, the line does not load properly, it needs an update to the zoom to show up. + map.addMarker(new Marker(new MarkerOptions() + .position(new LatLong( + chunks.get(0).getFirstPoint().getLatitude(), + chunks.get(0).getFirstPoint().getLongitude())) + .title("label.begin"))); map.addMapShape(new Polyline(new PolylineOptions().path(pathArray))); + map.addMarker(new Marker(new MarkerOptions() + .position(new LatLong( + chunks.get(chunks.size() - 1).getLastPoint().getLatitude(), + chunks.get(chunks.size() - 1).getLastPoint().getLongitude())) + .title("label.end"))); // Adjust the map to the correct center and zoom map.fitBounds(new LatLongBounds( new LatLong(coord[S], coord[W]), diff --git a/src/main/resources/general.properties b/src/main/resources/general.properties index 111715e..39341a7 100644 --- a/src/main/resources/general.properties +++ b/src/main/resources/general.properties @@ -25,9 +25,11 @@ app.extension=GPX data files app.title=ESTRABA +label.begin=Salida label.cadence=Cadence label.distance=Distance label.elevation=Elevation +label.end=Meta label.hr=Heart rate label.loadGPX=Load GPX file label.motivation=Welcome! diff --git a/src/main/resources/general_ca.properties b/src/main/resources/general_ca.properties index 41e1d05..7e4699a 100644 --- a/src/main/resources/general_ca.properties +++ b/src/main/resources/general_ca.properties @@ -25,9 +25,11 @@ app.extension=Arxius GPX app.title=ESTRABA +label.begin=Salida label.cadence=Cadencia label.distance=Distancia label.elevation=Elevacion +label.end=Meta label.hr=YOLO label.loadGPX=Obrir arxiu GPX label.motivation=\u00a1Benvinguts! diff --git a/src/main/resources/general_es.properties b/src/main/resources/general_es.properties index 1e10e76..20b3b56 100644 --- a/src/main/resources/general_es.properties +++ b/src/main/resources/general_es.properties @@ -25,9 +25,11 @@ app.extension=Archivos de datos GPX app.title=ESTRABA +label.begin=Salida label.cadence=Cadencia label.distance=Distancia label.elevation=Elevacion +label.end=Meta label.hr=Pulsaci\u00f3nes label.loadGPX=Abrir archivo GPX label.motivation=\u00a1Bienvenido!