EddyVerbruggen / nativescript-directions

:point_up_2: :point_right: :point_down: :point_left: Open the Maps app to show directions to anywhere you like
MIT License
83 stars 21 forks source link

How to send to: lat lng #21

Closed delanick closed 6 years ago

delanick commented 6 years ago

@EddyVerbruggen Hi, it says that if we add an address then the lat lng will be ignored, how do we add the coordinates? There is no option for it. Please advise.

delanick commented 6 years ago

Hey @EddyVerbruggen never mind - I see in the demo code how to add it. Apologies bud, you can close this issue/question :)

As always, awesome work and thanks for your superb examples and documentation!!

delanick commented 6 years ago

@EddyVerbruggen apologies bud, another question: If I have both the address and the coordinates, is there a way to default to the coordinates if the address isn't found? I'm wondering incase people enter their address incorrectly (spelling mistakes) but have also included their location coordinates (which I do cater for) whether the app can default to that.

Please let me know :)

EddyVerbruggen commented 6 years ago

The plugin passes the source to the native apps and it has to be one or the other (no fallback possible). If you know the coordinates just use that.

For completeness, here's the plugin code that calls the native apps:

https://github.com/EddyVerbruggen/nativescript-directions/blob/efd5f64491dd3aa1920511244ed688ac10038487/src/directions.common.ts#L58-L68

delanick commented 6 years ago

Thanks @EddyVerbruggen I wrote my code to check for coordinates and to fail to the address if no coordinates are found. I'm essentially trying to ensure that I use the right location, even if users (dumb ones...) spell their street name incorrectly...

Thanks though!