From 8514e8a2ce77240238679c060f61f40a3f74f938 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Thu, 7 Sep 2017 12:44:40 +0200 Subject: [PATCH] Update GeoPointParserUtil.java --- .../src/net/osmand/util/GeoPointParserUtil.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java b/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java index 65b991ed2d..3ba017c126 100644 --- a/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java +++ b/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java @@ -956,20 +956,14 @@ public class GeoPointParserUtil { } else if (queryMap != null) { String queryStr = queryMap.get("query"); if (queryStr != null) { - String[] vls = null; - if (queryStr.contains(",")) { - vls = queryStr.split("/|,"); - } else if (queryStr.contains(" ")) { - vls = queryStr.split(" "); - } + queryStr = queryStr.replace("+", " ").replace("/|,", " "); + String[] vls = queryStr.split(" "); if (vls != null && vls.length == 2) { lat = parseSilentDouble(vls[0]); lon = parseSilentDouble(vls[1]); - if (lat == 0 || lon == 0) { - return new GeoParsedPoint(queryStr.replace("+", " ").replace("/|,", " ")); - } - } else { - return new GeoParsedPoint(queryStr.replace("+", " ").replace("/|,", " ")); + } + if (lat == 0 || lon == 0) { + return new GeoParsedPoint(queryStr); } } }