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)
- Unnecessary detour in pedestrian navigation HOT 6
- Abnormal work of Attach to the roads HOT 6
- Custom bicycle routing different speed on different hills HOT 3
- Add maximum level of slope to a routing parameters
- Add UNESCO POIs HOT 2
- Speedometer using external sensor value
- crash after editing a track HOT 2
- Closed bridge HOT 5
- Wrong turn indication in lanes widget HOT 1
- True and magnetic bearings in route planning
- Displaying true and magnetic bearing on the widget the radius of the ruler
- Osmand gets really slow and crashes at max zoom level HOT 4
- Android app crashes HOT 7
- OpenStreetMap editor plugin failed to login HOT 3
- Consolidate map names HOT 1
- Please Add "NEW IN VERSION" header to F-Droid Store Listing HOT 3
- Dynamic waypoint/favourite name setting HOT 1
- Osm in jetpack compose
- Include Hash of .apk App Signing Key in README
- Distance between two points HOT 3
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.