question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

If title, source, and destination options are included, apple-maps may fail to display directions

See original GitHub issue

When I include source and destination lat/lng along with a title as options, apple-maps attempts to lookup the title as the destination. If the title is a custom name and apple-maps is unable to find it as a location, a “no results found” state is reached, and no directions are displayed.

I believe this is caused by line 72 within src/index.js:

url += `&q=${title ? `${encodedTitle}&address=${encodedTitle}` : 'Location'}`

It seems as though the title is being treated as an address.

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Arykcommented, Apr 29, 2021

Alright…I did some research:

https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html

It’s actually super confusing,

For “q”:

The query. This parameter is treated as if its value had been typed into the Maps search field by the user. Note that q=* is not supported The q parameter can also be used as a label if the location is explicitly defined in the ll or address parameters.

For “address”:

The address. Using the address parameter simply displays the specified location, it does not perform a search for the location.

I did some testing without having a source destination…and seems to be working without address. With a destination (directions), it “works” but does not show the title. I’m not sure if it’s supposed to but at least it’s not broken.

Based on:

  1. What I’ve read on the internet, it’s not possible to do a query link to Apple maps, and display a label AND do directions. I’ve tried various combinations and cannot get it work.
  2. Removing the “address” does not break things when source is not specified and also does not break things when source is defined (as opposed to now it’s completely broken).

I propose:

Remove “address” as mentioned above. PR is attached.

1reaction
chrise86commented, May 17, 2020

Google Maps also seems to use the title.

EDIT: I guess that’s why googleForceLatLon exists 🤦

Read more comments on GitHub >

github_iconTop Results From Across the Web

If Maps isn't working on your Apple device
Turn on Location Services and Location Access for Maps. In the Settings app, tap Privacy, then tap Location Services.
Read more >
Places Library | Maps JavaScript API - Google Developers
The input can be any kind of Place data, for example a business name or address. To make a Find Place from Query...
Read more >
ios - How to invoke iPhone Maps for Directions with Current ...
But I'm wondering if it's possible to make the start address be the "Current Location" maps bookmark so that I can use the...
Read more >
How to use multi-stop routing in iOS 16 using Apple Maps
Maps will calculate your route (or routes, if there are alternatives). In the text directions, tap on Add Stop and add the place,...
Read more >
NissanConnect Support & FAQ | Nissan USA
NissanConnect® support. Make the most out of NissanConnect and drive in connected comfort and convenience, mile after mile. Have a question about feature ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found