From d46be4f573c20a2a41f24fd7c341f17758d161cb Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Fri, 25 Dec 2015 19:06:52 +0300 Subject: [PATCH] Try fix gps loc at exif (nexus) --- .../osmand/plus/audionotes/AudioVideoNotesPlugin.java | 9 +++++++-- .../net/osmand/plus/base/MapViewTrackingUtilities.java | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index 6c517f2627..038b9c0b87 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -1156,8 +1156,13 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { // camera focus type autofocus = true; - //parameters.setGpsLatitude(lat); - //parameters.setGpsLongitude(lon); + parameters.removeGpsData(); + String locProvider = mapActivity.getMapViewTrackingUtilities().getLocationProvider(); + if (!Algorithms.isEmpty(locProvider)) { + parameters.setGpsLatitude(lat); + parameters.setGpsLongitude(lon); + parameters.setGpsProcessingMethod(locProvider.toUpperCase()); + } switch (AV_CAMERA_FOCUS_TYPE.get()) { case AV_CAMERA_FOCUS_HIPERFOCAL: parameters.setFocusMode(Parameters.FOCUS_MODE_FIXED); diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 060c06167a..bca22fc246 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -42,6 +42,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc private boolean routePlanningMode; private boolean showViewAngle = false; private boolean isUserZoomed = false; + private String locationProvider; public MapViewTrackingUtilities(OsmandApplication app){ this.app = app; @@ -73,7 +74,11 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc mapView.setMapLocationListener(this); } } - + + public String getLocationProvider() { + return locationProvider; + } + @Override public void updateCompassValue(float val) { if (mapView != null) { @@ -104,6 +109,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc @Override public void updateLocation(Location location) { showViewAngle = false; + locationProvider = location.getProvider(); if (mapView != null) { RotatedTileBox tb = mapView.getCurrentRotatedTileBox(); if (isMapLinkedToLocation() && location != null) {