Merge pull request #10600 from osmandapp/fix_coordinates_format
Fix #10517
This commit is contained in:
commit
bead08eb24
2 changed files with 9 additions and 5 deletions
|
@ -333,8 +333,8 @@ public class MapUtils {
|
|||
});
|
||||
}
|
||||
|
||||
public static String buildGeoUrl(double latitude, double longitude, int zoom) {
|
||||
return "geo:" + ((float) latitude) + "," + ((float) longitude) + "?z=" + zoom;
|
||||
public static String buildGeoUrl(String latitude, String longitude, int zoom) {
|
||||
return "geo:" + latitude + "," + longitude + "?z=" + zoom;
|
||||
}
|
||||
|
||||
// Examples
|
||||
|
|
|
@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
|
|||
import androidx.core.text.TextUtilsCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import net.osmand.LocationConvert;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
|
@ -99,10 +100,13 @@ public class ShareMenu extends BaseMenuController {
|
|||
if (mapActivity == null) {
|
||||
return;
|
||||
}
|
||||
String lat = LocationConvert.convertLatitude(latLon.getLatitude(), LocationConvert.FORMAT_DEGREES, false);
|
||||
String lon = LocationConvert.convertLongitude(latLon.getLongitude(), LocationConvert.FORMAT_DEGREES, false);
|
||||
lat = lat.substring(0, lat.length() - 1);
|
||||
lon = lon.substring(0, lon.length() - 1);
|
||||
final int zoom = mapActivity.getMapView().getZoom();
|
||||
final String geoUrl = MapUtils.buildGeoUrl(latLon.getLatitude(), latLon.getLongitude(), zoom);
|
||||
final String httpUrl = "https://osmand.net/go?lat=" + ((float) latLon.getLatitude())
|
||||
+ "&lon=" + ((float) latLon.getLongitude()) + "&z=" + zoom;
|
||||
final String geoUrl = MapUtils.buildGeoUrl(lat, lon, zoom);
|
||||
final String httpUrl = "https://osmand.net/go?lat=" + lat + "&lon=" + lon + "&z=" + zoom;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (!Algorithms.isEmpty(title)) {
|
||||
sb.append(title).append("\n");
|
||||
|
|
Loading…
Reference in a new issue