Merge pull request #10494 from osmandapp/fix_using_google_maps_links
Fix opening links to maps "geo:0,0"
This commit is contained in:
commit
46005225fd
1 changed files with 11 additions and 2 deletions
|
@ -553,11 +553,20 @@ public class GeoPointParserUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searchRequest != null) {
|
if (searchRequest != null) {
|
||||||
|
String searchPattern = Pattern.compile("(?:\\.|,|\\s+|\\+|[+-]?\\d+(?:\\.\\d+)?)").pattern();
|
||||||
|
String[] search = searchRequest.split(searchPattern);
|
||||||
|
if (search.length > 0) {
|
||||||
|
return new GeoParsedPoint(searchRequest);
|
||||||
|
}
|
||||||
final Matcher positionInSearchRequestMatcher =
|
final Matcher positionInSearchRequestMatcher =
|
||||||
positionPattern.matcher(searchRequest);
|
positionPattern.matcher(searchRequest);
|
||||||
if (lat == 0.0 && lon == 0.0 && positionInSearchRequestMatcher.find()) {
|
if (lat == 0.0 && lon == 0.0 && positionInSearchRequestMatcher.find()) {
|
||||||
lat = Double.valueOf(positionInSearchRequestMatcher.group(1));
|
double tempLat = Double.valueOf(positionInSearchRequestMatcher.group(1));
|
||||||
lon = Double.valueOf(positionInSearchRequestMatcher.group(2));
|
double tempLon = Double.valueOf(positionInSearchRequestMatcher.group(2));
|
||||||
|
if (tempLat >= -90 && tempLat <= 90 && tempLon >= -180 && tempLon <= 180) {
|
||||||
|
lat = tempLat;
|
||||||
|
lon = tempLon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue