diff --git a/build.gradle b/build.gradle
index 9d13f7802..bcbdeb253 100644
--- a/build.gradle
+++ b/build.gradle
@@ -103,7 +103,7 @@ dependencies {
// Locus Maps integration
//noinspection GradleDependency
- implementation 'com.asamm:locus-api-android:0.2.7'
+ implementation 'com.asamm:locus-api-android:0.9.45'
// openwig@cgeo
implementation 'com.github.cgeo:openwig:1.0.0'
diff --git a/src/main/java/menion/android/whereyougo/geo/location/Location.java b/src/main/java/menion/android/whereyougo/geo/location/Location.java
index 78a98de6c..e17bef25c 100644
--- a/src/main/java/menion/android/whereyougo/geo/location/Location.java
+++ b/src/main/java/menion/android/whereyougo/geo/location/Location.java
@@ -7,10 +7,10 @@ public Location() {
}
public Location(android.location.Location loc) {
- this(loc.getProvider(), loc.getLatitude(), loc.getLongitude());
+ this(loc.getLatitude(), loc.getLongitude());
setTime(loc.getTime());
if (loc.hasAccuracy()) {
- setAccuracy(loc.getAccuracy());
+ setAccuracyHor(loc.getAccuracy());
}
if (loc.hasAltitude()) {
setAltitude(loc.getAltitude());
@@ -27,12 +27,8 @@ public Location(Location loc) {
super(loc);
}
- public Location(String provider) {
- super(provider);
- }
-
- public Location(String provider, double lat, double lon) {
- super(provider, lat, lon);
+ public Location(double lat, double lon) {
+ super(lat, lon);
}
@Override
diff --git a/src/main/java/menion/android/whereyougo/geo/location/LocationState.java b/src/main/java/menion/android/whereyougo/geo/location/LocationState.java
index 5321cf806..0f041f89c 100644
--- a/src/main/java/menion/android/whereyougo/geo/location/LocationState.java
+++ b/src/main/java/menion/android/whereyougo/geo/location/LocationState.java
@@ -1,17 +1,17 @@
/*
* This file is part of WhereYouGo.
- *
+ *
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not,
* see .
- *
+ *
* Copyright (C) 2012 Menion
*/
@@ -147,7 +147,7 @@ public static Location getLastKnownLocation(Activity activity) {
public static Location getLocation() {
if (location == null)
- return new Location(TAG);
+ return new Location();
return new Location(location);
}
@@ -331,7 +331,7 @@ static void onLocationChanged(Location location) {
// if first location from Network, and new from GPS but with worst precision, do not set
if (LocationState.location.getProvider().equals(LocationManager.NETWORK_PROVIDER)
&& location.getProvider().equals(LocationManager.GPS_PROVIDER)
- && (LocationState.location.getAccuracy() * 3) < location.getAccuracy()) {
+ && (LocationState.location.getAccuracyHor() * 3) < location.getAccuracyHor()) {
return;
}
diff --git a/src/main/java/menion/android/whereyougo/gui/activity/CartridgeDetailsActivity.java b/src/main/java/menion/android/whereyougo/gui/activity/CartridgeDetailsActivity.java
index b80645623..0e3eb4f9c 100644
--- a/src/main/java/menion/android/whereyougo/gui/activity/CartridgeDetailsActivity.java
+++ b/src/main/java/menion/android/whereyougo/gui/activity/CartridgeDetailsActivity.java
@@ -74,7 +74,7 @@ public void onCreate(Bundle savedInstanceState) {
TextView tvDistance = (TextView) findViewById(R.id.layoutDetailsTextViewDistance);
- Location loc = new Location(TAG);
+ Location loc = new Location();
loc.setLatitude(MainActivity.cartridgeFile.latitude);
loc.setLongitude(MainActivity.cartridgeFile.longitude);
@@ -92,7 +92,7 @@ public void onCreate(Bundle savedInstanceState) {
MainActivity.startSelectedCartridge(false);
return true;
}, null, null, getString(R.string.navigate), (dialog, v, btn) -> {
- Location loc1 = new Location(TAG);
+ Location loc1 = new Location();
loc1.setLatitude(MainActivity.cartridgeFile.latitude);
loc1.setLongitude(MainActivity.cartridgeFile.longitude);
Guide guide = new Guide(MainActivity.cartridgeFile.name, loc1);
diff --git a/src/main/java/menion/android/whereyougo/gui/activity/GuidingActivity.java b/src/main/java/menion/android/whereyougo/gui/activity/GuidingActivity.java
index 3e017eff5..4c06a7fa7 100644
--- a/src/main/java/menion/android/whereyougo/gui/activity/GuidingActivity.java
+++ b/src/main/java/menion/android/whereyougo/gui/activity/GuidingActivity.java
@@ -1,17 +1,17 @@
/*
* This file is part of WhereYouGo.
- *
+ *
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not,
* see .
- *
+ *
* Copyright (C) 2012 Menion
*/
@@ -132,7 +132,7 @@ public void onOrientationChanged(float azimuth, float pitch, float roll) {
viewLat.setText(UtilsFormat.formatLatitude(loc.getLatitude()));
viewLon.setText(UtilsFormat.formatLongitude(loc.getLongitude()));
viewAlt.setText(UtilsFormat.formatAltitude(loc.getAltitude(), true));
- viewAcc.setText(UtilsFormat.formatDistance((double) loc.getAccuracy(), false));
+ viewAcc.setText(UtilsFormat.formatDistance((double) loc.getAccuracyHor(), false));
viewSpeed.setText(UtilsFormat.formatSpeed(loc.getSpeed(), false));
repaint();
diff --git a/src/main/java/menion/android/whereyougo/gui/activity/MainActivity.java b/src/main/java/menion/android/whereyougo/gui/activity/MainActivity.java
index 291860701..8ed2cd5cf 100644
--- a/src/main/java/menion/android/whereyougo/gui/activity/MainActivity.java
+++ b/src/main/java/menion/android/whereyougo/gui/activity/MainActivity.java
@@ -1,17 +1,17 @@
/*
* This file is part of WhereYouGo.
- *
+ *
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not,
* see .
- *
+ *
* Copyright (C) 2012 Menion
*/
@@ -49,7 +49,8 @@
import cz.matejcik.openwig.Engine;
import cz.matejcik.openwig.formats.CartridgeFile;
import locus.api.objects.extra.Location;
-import locus.api.objects.extra.Waypoint;
+
+//import locus.api.objects.extra.Waypoint;
import menion.android.whereyougo.MainApplication;
import menion.android.whereyougo.R;
@@ -179,9 +180,6 @@ public static void refreshCartridges() {
File[] files = FileSystem.getFiles(FileSystem.ROOT, "gwc");
cartridgeFiles = new Vector<>();
- // add cartridges to map
- ArrayList wpts = new ArrayList<>();
-
File actualFile = null;
if (files != null) {
for (File file : files) {
@@ -190,26 +188,14 @@ public static void refreshCartridges() {
CartridgeFile cart = CartridgeFile.read(new WSeekableFile(file), new WSaveFile(file));
if (cart != null) {
cart.filename = file.getAbsolutePath();
-
- Location loc = new Location(TAG);
- loc.setLatitude(cart.latitude);
- loc.setLongitude(cart.longitude);
- Waypoint waypoint = new Waypoint(cart.name, loc);
-
cartridgeFiles.add(cart);
- wpts.add(waypoint);
}
} catch (Exception e) {
Logger.w(TAG, "refreshCartridge(), file:" + actualFile + ", e:" + e.toString());
ManagerNotify.toastShortMessage(Locale.getString(R.string.invalid_cartridge, actualFile.getName()));
- // file.delete();
}
}
}
-
- if (wpts.size() > 0) {
- // TODO add items on map
- }
}
public static void openCartridge(final CartridgeFile cartridgeFile) {
diff --git a/src/main/java/menion/android/whereyougo/gui/activity/SatelliteActivity.java b/src/main/java/menion/android/whereyougo/gui/activity/SatelliteActivity.java
index 28e8442d2..dd0bf60e6 100644
--- a/src/main/java/menion/android/whereyougo/gui/activity/SatelliteActivity.java
+++ b/src/main/java/menion/android/whereyougo/gui/activity/SatelliteActivity.java
@@ -1,17 +1,17 @@
/*
* This file is part of WhereYouGo.
- *
+ *
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not,
* see .
- *
+ *
* Copyright (C) 2012 Menion
*/
@@ -162,7 +162,7 @@ public void run() {
((TextView) findViewById(R.id.text_view_altitude)).setText(UtilsFormat.formatAltitude(
location.getAltitude(), true));
((TextView) findViewById(R.id.text_view_accuracy)).setText(UtilsFormat.formatDistance(
- location.getAccuracy(), false));
+ location.getAccuracyHor(), false));
((TextView) findViewById(R.id.text_view_speed)).setText(UtilsFormat.formatSpeed(
location.getSpeed(), false));
((TextView) findViewById(R.id.text_view_declination)).setText(UtilsFormat
diff --git a/src/main/java/menion/android/whereyougo/gui/dialog/ChooseCartridgeDialog.java b/src/main/java/menion/android/whereyougo/gui/dialog/ChooseCartridgeDialog.java
index 83f28080d..d8572c0f9 100644
--- a/src/main/java/menion/android/whereyougo/gui/dialog/ChooseCartridgeDialog.java
+++ b/src/main/java/menion/android/whereyougo/gui/dialog/ChooseCartridgeDialog.java
@@ -50,8 +50,8 @@ public Dialog createDialog(Bundle savedInstanceState) {
try {
// sort cartridges
final Location actLoc = LocationState.getLocation();
- final Location loc1 = new Location(TAG);
- final Location loc2 = new Location(TAG);
+ final Location loc1 = new Location();
+ final Location loc2 = new Location();
Collections.sort(cartridgeFiles, (object1, object2) -> {
loc1.setLatitude(object1.latitude);
loc1.setLongitude(object1.longitude);
diff --git a/src/main/java/menion/android/whereyougo/gui/extension/DataInfo.java b/src/main/java/menion/android/whereyougo/gui/extension/DataInfo.java
index f2752b574..c607407ca 100644
--- a/src/main/java/menion/android/whereyougo/gui/extension/DataInfo.java
+++ b/src/main/java/menion/android/whereyougo/gui/extension/DataInfo.java
@@ -1,17 +1,17 @@
/*
* This file is part of WhereYouGo.
- *
+ *
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not,
* see .
- *
+ *
* Copyright (C) 2012 Menion
*/
@@ -175,7 +175,7 @@ public DataInfo setImageRight(Bitmap image) {
}
public Location getLocation() {
- Location loc = new Location(TAG);
+ Location loc = new Location();
loc.setLatitude(value01);
loc.setLongitude(value02);
return loc;
diff --git a/src/main/java/menion/android/whereyougo/guide/ZoneGuide.java b/src/main/java/menion/android/whereyougo/guide/ZoneGuide.java
index 92e4caf1a..5abefec3a 100644
--- a/src/main/java/menion/android/whereyougo/guide/ZoneGuide.java
+++ b/src/main/java/menion/android/whereyougo/guide/ZoneGuide.java
@@ -12,8 +12,7 @@ public class ZoneGuide extends Guide {
private boolean mAlreadyEntered = false;
public ZoneGuide(Zone zone) {
- super(zone.name, new Location("Guidance: " + zone.name, zone.bbCenter.latitude,
- zone.bbCenter.longitude));
+ super(zone.name, new Location(zone.bbCenter.latitude, zone.bbCenter.longitude));
mZone = zone;
mAlreadyEntered = false;
}
@@ -21,14 +20,14 @@ public ZoneGuide(Zone zone) {
/*
* public void actualizeState(Location location) { super.actualizeState(location); if
* (mAlreadyEntered == false && mZone.contain == Zone.INSIDE) { mAlreadyEntered = true;
- *
+ *
* // issue #54 - acoustical switch (Preferences.GUIDING_WAYPOINT_SOUND) { case
* PreferenceValues.VALUE_GUIDING_WAYPOINT_SOUND_INCREASE_CLOSER: case
* PreferenceValues.VALUE_GUIDING_WAYPOINT_SOUND_BEEP_ON_DISTANCE: playSingleBeep(); break; case
* PreferenceValues.VALUE_GUIDING_WAYPOINT_SOUND_CUSTOM_SOUND: playCustomSound(); break; }
- *
+ *
* // issue #54 - visual //ManagerNotify.toastShortMessage(R.string.guidance_zone_entered);
- *
+ *
* // issue #54 - vibration Vibrator v = (Vibrator)
* A.getMain().getSystemService(Context.VIBRATOR_SERVICE); v.vibrate(50); } }
*/
diff --git a/src/main/java/menion/android/whereyougo/maps/utils/LocusMapDataProvider.java b/src/main/java/menion/android/whereyougo/maps/utils/LocusMapDataProvider.java
index 373eaaeaa..9daaf94e2 100644
--- a/src/main/java/menion/android/whereyougo/maps/utils/LocusMapDataProvider.java
+++ b/src/main/java/menion/android/whereyougo/maps/utils/LocusMapDataProvider.java
@@ -1,14 +1,14 @@
/*
* Copyright 2013, 2014 biylda
- *
+ *
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with this program. If not,
* see .
*/
@@ -24,14 +24,13 @@
import cz.matejcik.openwig.EventTable;
import cz.matejcik.openwig.Zone;
import cz.matejcik.openwig.formats.CartridgeFile;
-import locus.api.android.objects.PackWaypoints;
-import locus.api.objects.extra.ExtraData;
-import locus.api.objects.extra.ExtraStyle;
-import locus.api.objects.extra.ExtraStyle.LineStyle.ColorStyle;
-import locus.api.objects.extra.ExtraStyle.LineStyle.Units;
+import locus.api.android.objects.PackPoints;
+import locus.api.objects.extra.GeoDataExtra;
+import locus.api.objects.styles.GeoDataStyle;
+import locus.api.objects.styles.LineStyle;
import locus.api.objects.extra.Location;
-import locus.api.objects.extra.Track;
-import locus.api.objects.extra.Waypoint;
+import locus.api.objects.geoData.Track;
+import locus.api.objects.geoData.Point;
import menion.android.whereyougo.gui.activity.MainActivity;
import menion.android.whereyougo.gui.activity.wherigo.DetailsActivity;
import menion.android.whereyougo.gui.utils.UtilsWherigo;
@@ -39,11 +38,11 @@
public class LocusMapDataProvider implements MapDataProvider {
private static LocusMapDataProvider instance = null;
private ArrayList