Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ When user selects a pin, your app is called like this:

YourAppUniqueUrlScheme://pin?ll=lat,lon&n=PinName&id=PinId

Organic Maps also supports v2 route deep links. You can open them directly from
your app, for example to preview a route with intermediate stops:

NSURL * url = [NSURL URLWithString:@"om://v2/dir?origin=52.5200,13.4050&origin_name=Warehouse%20Berlin&destination=52.5163,13.3777&destination_name=Customer&waypoints=52.5304,13.3850|52.5450,13.3920&waypoint_names=Pickup%201|Pickup%202&mode=drive"];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Percent-encode waypoint separators in sample deep link

The new Objective-C example uses raw | characters inside the query string (waypoints and waypoint_names), but +[NSURL URLWithString:] treats that URL as invalid and returns nil in this context. That means the sample call to openURL: will not open Organic Maps when copied as-is from the README. Encode the separators as %7C so the constructed NSURL is valid.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kirylkaveryn is it correct or not?

[[UIApplication sharedApplication] openURL:url];

Use `om://v2/nav` instead of `om://v2/dir` to start navigation when the route is
ready. If `origin` is an explicit coordinate instead of `currentLocation`,
Organic Maps previews the route first so the user can confirm the start point.

------------------------------------------------------------------------------------------
### API Code is licensed under the BSD 2-Clause License

Expand Down