Merge pull request #712 from Bars107/master

Fix to Jira bug 107
This commit is contained in:
vshcherb 2014-06-24 22:40:09 +02:00
commit d42ad87182

View file

@ -312,8 +312,15 @@ public class GeoIntentActivity extends OsmandListActivity {
//geo:47.6,-122.3?z=11
//allow for http://tools.ietf.org/html/rfc5870 (geo uri) , just ignore everything after ';'
final String pattern = "([\\-0-9.]+),([\\-0-9.]+)(?:,([\\-0-9.]+))?(?:\\?z=([0-9]+))?(?:;.*)?";
int indexQ = schemeSpecific.indexOf("&q");
final Matcher matcher;
if (indexQ != -1){
final String schemeQ = schemeSpecific.substring(0,indexQ);
matcher = Pattern.compile(pattern).matcher(schemeQ);
} else {
matcher = Pattern.compile(pattern).matcher(schemeSpecific);
}
final Matcher matcher = Pattern.compile(pattern).matcher(schemeSpecific);
if (matcher.matches())
{
final double lat = Double.valueOf(matcher.group(1));