Comments (1)
No way to attach patches? So here it is a plain text...
From 311e9c48e31629bca0d88e1f628ac0f0f63a12bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= <[email protected]>
Date: Sun, 15 Sep 2013 22:12:38 +0200
Subject: [PATCH] Make geo: URI parsing more resilient.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In particular accept URIs with altitude and parameters like
geo:52,0,123;u=5?something
While e.g. Google maps seems to fail with those, apps like
QR droid accept them.
Signed-off-by: Reimar Döffinger <[email protected]>
---
.../src/net/osmand/plus/activities/search/GeoIntentActivity.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java
index dcadb2b..3e7e116 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java
@@ -232,9 +232,13 @@ public class GeoIntentActivity extends OsmandListActivity {
showErrorMessage("");
} else {
int latIndex = geo.indexOf(',');
- int lonIndex = geo.indexOf('?');
- lonIndex = lonIndex > 0 ? lonIndex : geo.length();
if (latIndex > 0) {
+ int lonIndex = geo.indexOf(',', latIndex + 1);
+ int altIndex = geo.indexOf(';', latIndex + 1);
+ int paramIndex = geo.indexOf('?', latIndex + 1);
+ paramIndex = paramIndex > 0 ? paramIndex : geo.length();
+ altIndex = altIndex > 0 && altIndex < paramIndex ? altIndex : paramIndex;
+ lonIndex = lonIndex > 0 && lonIndex < altIndex ? lonIndex : altIndex;
try {
double lat = Double.parseDouble(geo.substring(0, latIndex).trim());
double lon = Double.parseDouble(geo.substring(latIndex + 1, lonIndex).trim());
--
1.8.4.rc3
from osmand.
Related Issues (20)
- Export Track HOT 2
- Address search does not extend beyond 500 km HOT 2
- Beginning of the track by default HOT 2
- Search does not find Scottish parliament despite me hovering over it HOT 3
- “Announce deviation from route” should run with every setting HOT 3
- Excessive heating of the phone when using OsmAnd+ (most of the time with Android Auto) HOT 3
- Required Maps dialogs reappears each time on Back button
- Regression : Opengl crashes OsmAnd and is very slow when Live enabled HOT 7
- Outdated menu item HOT 2
- Add an icon to motorway junctions
- Deletion error from search list HOT 2
- Tertiary links and tertiary roads are displayed the same way in UniRS map style
- Add other App Theme options
- OSM Live changes don't appear in Version 2 rendering, but do in Version 1 HOT 1
- Avoid loop in the announcement of Route Recalculation HOT 2
- Location Not Yet Known HOT 3
- Introduce a new road-style "pale"
- OsmAnd Online GPS Tracker stuck at Authorization HOT 3
- "position teleport" in track recording after pause/resume HOT 1
- When changing a recorded track's name before saving, use that name in GPX, too HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osmand.