3.0.2 • Published 4 years ago

react-native-open-map v3.0.2

Weekly downloads
917
License
MIT
Repository
github
Last release
4 years ago

React Native Open Map

npm version npm downloads Publish Package

NPM

Choose the application that will open the map

Currently supported apps:

  • Apple Maps – apple-maps
  • Google Maps – google-maps
  • Citymapper – citymapper
  • Uber – uber
  • Lyft – lyft
  • Navigon – navigon
  • The Transit App – transit
  • Waze – waze
  • Moovit - moovit

Try it out

You can try out the Open Map Example app to get a tease of the functionalities of this lib.

Installation

npm install --save react-native-open-map
yarn add react-native-open-map

A note about iOS 9+

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>

Props

PropDefaultTypeRequired
latitudenonenumber/stringyes
longitudenonenumber/stringyes
title"Location"stringno
cancelText"Cancel"stringno
actionSheetTitlenonestringno
actionSheetMessagenonestringno

Usage

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 '
});

Credits

This library is based on react-native-map-link.

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.9.1

6 years ago

1.9.0

6 years ago

1.8.0

6 years ago

1.7.0

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago