Choose the application that will open the map
- Apple Maps –
apple-maps
- Google Maps –
google-maps
- Citymapper –
citymapper
- Uber –
uber
- Lyft –
lyft
- Navigon –
navigon
- The Transit App –
transit
- Waze –
waze
- Moovit -
moovit
You can try out the Open Map Example app to get a tease of the functionalities of this lib.
npm install --save react-native-open-map
yarn add react-native-open-map
As of iOS 9, your app needs to provide the LSApplicationQueriesSchemes
key inside
Info.plist to specify the URL schemes with which the app can interact.
Just put this in your Info.plist depending on which apps you'd like to support. Omitting these might mean that the library can't detect some of the maps apps installed by the user.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>comgooglemaps</string>
<string>citymapper</string>
<string>uber</string>
<string>lyft</string>
<string>navigon</string>
<string>transit</string>
<string>waze</string>
<string>moovit</string>
</array>
Prop | Default | Type | Required |
---|---|---|---|
latitude | none | number/string | yes |
longitude | none | number/string | yes |
title | "Location" | string | no |
cancelText | "Cancel" | string | no |
actionSheetTitle | none | string | no |
actionSheetMessage | none | string | no |
import OpenMap from "react-native-open-map";
OpenMap.show({
latitude: 40.778721,
longitude: -73.968188,
});
OpenMap.show({
latitude: 40.778721,
longitude: -73.968188,
title: 'Central Park',
cancelText: 'Close',
actionSheetTitle: 'Chose app',
actionSheetMessage: 'Available applications '
});
This library is based on react-native-map-link.