brh55 / react-native-open-maps

🗺 A simple react-native library to perform cross-platform map actions (Google, Apple, or Yandex Maps)
MIT License
359 stars 47 forks source link

End attribute being ignored #50

Closed dawsboss closed 2 years ago

dawsboss commented 2 years ago

Hello, So when I use the open maps library I gave it a start, end, longitude, latitude, and query. All just to make sure that I would get an end result.

export const VenueScreen = ({ address = "1101 Camden Ave Salisbury MD 21120", Latitude = 38.344816112316856, Longitude = -75.6052115880242, phone = "410-555-0000", region = "Salisbury", ... }) => { ...

const _goToAdress = async () => { openMap({ latitude: Latitude, longitude: Longitude, navigate: true, query: address, start: region, end: address }); }

... }

The reason I use so many attributes is that I am not guaranteed to have anything other than the address, Longitude, and Latitude. Where I get a mass of errors when used,

Expected 'end' parameter in navigation, defaulting to preview mode.\ ...

dawsboss commented 2 years ago

I ended up with just using this code,

const _goToAdress = async () => { openMap({ navigate: true, query: address, start: address, end: address }); }

I just use the query instead of the Longitude and Latitude. In my case, the address is guaranteed and the region was not so I used the address twice and it worked, no more errors.