├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── LICENSE ├── README.md ├── example ├── .expo-shared │ └── assets.json ├── .gitignore ├── App.js ├── app.json ├── assets │ ├── icon.png │ └── splash.png ├── babel.config.js ├── package-lock.json └── package.json ├── package-lock.json ├── package.json └── src ├── ActionSheet.js ├── Apps.js ├── img ├── apple-maps.png ├── citymapper.png ├── google-maps.png ├── index.js ├── lyft.png ├── moovit.png ├── transit.png ├── uber.png └── waze.png ├── index.js └── url.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "react-native" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | example 2 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "parser":"babel-eslint", 3 | "parserOptions": { 4 | "ecmaVersion": 6, 5 | "sourceType": "module", 6 | "ecmaFeatures": { 7 | "jsx": true, 8 | "experimentalObjectRestSpread": true 9 | } 10 | }, 11 | "plugins": [ 12 | "react", 13 | "import" 14 | ], 15 | "extends" : [ 16 | "eslint:recommended", 17 | "plugin:react/recommended" 18 | ], 19 | "settings": { 20 | "react": { 21 | "version": "16.8.6" 22 | } 23 | }, 24 | "rules": { 25 | "indent": ["error", 2, { "SwitchCase": 1 }], 26 | "semi": 2, 27 | "quotes": [2, "single", "avoid-escape"], 28 | "prefer-destructuring": [2, {"object": true, "array": false}], 29 | "no-duplicate-imports": [2, { "includeExports": true }], 30 | "nonblock-statement-body-position": 2, 31 | "object-curly-spacing": [2, "always", { "objectsInObjects": true }], 32 | "space-before-blocks": 2, 33 | "comma-style": [2, "last"], 34 | "camelcase": [2, {"properties": "always"}], 35 | "id-length": [2, { "min": 2, "exceptions": ["r", "x", "y"] }], 36 | "space-infix-ops": 2, 37 | "no-console": [2, { "allow": ["warn", "error"] }], 38 | "no-undef": 1, 39 | "no-unused-vars": [2, { "args": "none" }], 40 | "import/extensions": 2, 41 | "import/no-absolute-path": 2, 42 | "import/no-dynamic-require": 2, 43 | "import/no-duplicates": 2, 44 | "import/newline-after-import": 2, 45 | "import/no-unassigned-import": 2, 46 | "import/no-unresolved": [2, { "commonjs": true, "amd": true }], 47 | "react/no-access-state-in-setstate": 2, 48 | "react/no-did-update-set-state": 2, 49 | "react/no-did-mount-set-state": 2, 50 | "react/no-is-mounted": 2, 51 | "react/no-will-update-set-state": 2, 52 | "react/style-prop-object": 2, 53 | "react/no-string-refs": 2, 54 | "react/self-closing-comp": 2, 55 | "react/jsx-closing-bracket-location": 2, 56 | "react/jsx-boolean-value": 2, 57 | "react/no-deprecated": 2, 58 | "react/forbid-prop-types": 0, 59 | "react/prefer-stateless-function": 2, 60 | "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], 61 | "react/jsx-no-duplicate-props": 2, 62 | "react/prop-types": [1, { "skipUndeclared": true }] 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Publish Package 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | prepare: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: actions/setup-node@v1 14 | with: 15 | node-version: 12 16 | - run: npm install 17 | - run: npm run lint 18 | 19 | publish-npm: 20 | needs: prepare 21 | runs-on: ubuntu-latest 22 | steps: 23 | - uses: actions/checkout@v2 24 | - uses: actions/setup-node@v1 25 | with: 26 | node-version: 12 27 | registry-url: 'https://registry.npmjs.org' 28 | - run: rm ./example -r 29 | - run: npm install 30 | - run: npm publish 31 | env: 32 | NODE_AUTH_TOKEN: ${{ secrets.npm_token }} 33 | 34 | publish-expo: 35 | needs: prepare 36 | runs-on: ubuntu-latest 37 | steps: 38 | - uses: actions/checkout@v2 39 | - uses: actions/setup-node@v1 40 | with: 41 | node-version: 12 42 | - uses: expo/expo-github-action@v5 43 | with: 44 | expo-version: 3.x 45 | expo-username: ${{ secrets.EXPO_CLI_USERNAME }} 46 | expo-password: ${{ secrets.EXPO_CLI_PASSWORD }} 47 | - run: npm install 48 | working-directory: ./example 49 | - run: expo publish 50 | working-directory: ./example 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | *.log 8 | build/ 9 | *.pbxuser 10 | !default.pbxuser 11 | *.mode1v3 12 | !default.mode1v3 13 | *.mode2v3 14 | !default.mode2v3 15 | *.perspectivev3 16 | !default.perspectivev3 17 | xcuserdata 18 | *.xccheckout 19 | *.moved-aside 20 | DerivedData 21 | *.hmap 22 | *.ipa 23 | *.xcuserstate 24 | project.xcworkspace 25 | yarn.lock 26 | !package-lock.json 27 | 28 | # Android/IntelliJ 29 | # 30 | build/ 31 | .idea 32 | .gradle 33 | local.properties 34 | *.iml 35 | 36 | # node.js 37 | # 38 | node_modules/ 39 | npm-debug.log 40 | yarn-error.log 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/ 52 | 53 | */fastlane/report.xml 54 | */fastlane/Preview.html 55 | */fastlane/screenshots 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Lucas Monteiro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native Open Map 2 | [![npm version](https://badge.fury.io/js/react-native-open-map.svg)](https://badge.fury.io/js/react-native-open-map) [![npm downloads](https://img.shields.io/npm/dt/react-native-open-map.svg)](https://npm-stat.com/charts.html?package=react-native-open-map) [![Publish Package](https://github.com/LucasMonteiro1/react-native-open-map/workflows/Publish%20Package/badge.svg?branch=master&event=push)](https://github.com/LucasMonteiro1/react-native-open-map/actions) 3 | [![NPM](https://nodei.co/npm/react-native-open-map.png?downloads=true)](https://nodei.co/npm/react-native-open-map/) 4 | --- 5 | Choose the application that will open the map 6 | 7 | ## Currently supported apps: 8 | 9 | * Apple Maps – `apple-maps` 10 | * Google Maps – `google-maps` 11 | * Citymapper – `citymapper` 12 | * Uber – `uber` 13 | * Lyft – `lyft` 14 | * Navigon – `navigon` 15 | * The Transit App – `transit` 16 | * Waze – `waze` 17 | * Moovit - `moovit` 18 | 19 | ## Try it out 20 | You can try out the [Open Map Example 21 | ](https://expo.io/@lucasmonteiro1/open-map-example) app to get a tease of the functionalities of this lib. 22 | 23 | ## Installation 24 | 25 | ``` 26 | npm install --save react-native-open-map 27 | ``` 28 | ``` 29 | yarn add react-native-open-map 30 | ``` 31 | 32 | ### A note about iOS 9+ 33 | As of iOS 9, your app needs to provide the `LSApplicationQueriesSchemes` key inside 34 | Info.plist to specify the URL schemes with which the app can interact. 35 | 36 | Just put this in your Info.plist depending on which apps you'd like to support. 37 | Omitting these might mean that the library can't detect some of the maps apps installed by the user. 38 | 39 | ```plist 40 | LSApplicationQueriesSchemes 41 | 42 | comgooglemaps 43 | citymapper 44 | uber 45 | lyft 46 | navigon 47 | transit 48 | waze 49 | moovit 50 | 51 | ``` 52 | ## Props 53 | | Prop | Default | Type | Required | 54 | | --- | --- | --- | --- | 55 | | latitude | none | number/string | yes | 56 | | longitude | none | number/string | yes | 57 | | title | "Location" | string | no | 58 | | cancelText | "Cancel" | string | no | 59 | | actionSheetTitle | none | string | no | 60 | | actionSheetMessage | none | string | no | 61 | 62 | ## Usage 63 | 64 | ```javascript 65 | import OpenMap from "react-native-open-map"; 66 | 67 | OpenMap.show({ 68 | latitude: 40.778721, 69 | longitude: -73.968188, 70 | }); 71 | ``` 72 | ```javascript 73 | OpenMap.show({ 74 | latitude: 40.778721, 75 | longitude: -73.968188, 76 | title: 'Central Park', 77 | cancelText: 'Close', 78 | actionSheetTitle: 'Chose app', 79 | actionSheetMessage: 'Available applications ' 80 | }); 81 | ``` 82 | 83 | ## Credits 84 | This library is based on [react-native-map-link](https://github.com/includable/react-native-map-link). 85 | -------------------------------------------------------------------------------- /example/.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/**/* 2 | .expo/* 3 | npm-debug.* 4 | *.jks 5 | *.p12 6 | *.key 7 | *.mobileprovision 8 | -------------------------------------------------------------------------------- /example/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StyleSheet, Text, View, TouchableHighlight } from 'react-native'; 3 | import OpenMap from 'react-native-open-map'; 4 | 5 | export default function App() { 6 | const openA = () => { 7 | OpenMap.show({ 8 | latitude: 40.778721, 9 | longitude: -73.968188, 10 | }); 11 | } 12 | 13 | const openB = () => { 14 | OpenMap.show({ 15 | alatitude: 40.778721, 16 | longitude: -73.968188, 17 | title: 'Central Park', 18 | cancelText: 'Close', 19 | actionSheetTitle: 'Chose app', 20 | actionSheetMessage: 'Available applications' 21 | }); 22 | } 23 | 24 | return ( 25 | 26 | React Native Open Map 27 | 28 | 29 | A 30 | 31 | 32 | 33 | B 34 | 35 | 36 | ); 37 | }; 38 | 39 | const styles = StyleSheet.create({ 40 | container: { 41 | flex: 1, 42 | backgroundColor: '#fff', 43 | alignItems: 'center', 44 | justifyContent: 'center', 45 | }, 46 | button: { 47 | padding: 10, 48 | backgroundColor: '#a6a6a6', 49 | margin: 10, 50 | width: '50%', 51 | alignItems: 'center', 52 | }, 53 | }); -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "React Native Open Map Example", 4 | "slug": "open-map-example", 5 | "privacy": "public", 6 | "sdkVersion": "36.0.0", 7 | "platforms": [ 8 | "ios", 9 | "android", 10 | "web" 11 | ], 12 | "version": "1.0.0", 13 | "orientation": "portrait", 14 | "icon": "./assets/icon.png", 15 | "splash": { 16 | "image": "./assets/splash.png", 17 | "resizeMode": "contain", 18 | "backgroundColor": "#ffffff" 19 | }, 20 | "updates": { 21 | "fallbackToCacheTimeout": 0 22 | }, 23 | "assetBundlePatterns": [ 24 | "**/*" 25 | ], 26 | "ios": { 27 | "supportsTablet": true 28 | }, 29 | "description": "Example for React Native Open Map", 30 | "githubUrl": "https://github.com/LucasMonteiro1/react-native-open-map/tree/master/example" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /example/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umer17/react-native-open-map/7195ff5455fbe459bad69715baf39b6a8eb5ae69/example/assets/icon.png -------------------------------------------------------------------------------- /example/assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umer17/react-native-open-map/7195ff5455fbe459bad69715baf39b6a8eb5ae69/example/assets/splash.png -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "node_modules/expo/AppEntry.js", 3 | "scripts": { 4 | "start": "expo start", 5 | "android": "expo start --android", 6 | "ios": "expo start --ios", 7 | "web": "expo start --web", 8 | "eject": "expo eject" 9 | }, 10 | "dependencies": { 11 | "expo": "~36.0.0", 12 | "react": "~16.9.0", 13 | "react-dom": "~16.9.0", 14 | "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz", 15 | "react-native-open-map": "^3.0.1", 16 | "react-native-web": "~0.11.7" 17 | }, 18 | "devDependencies": { 19 | "babel-preset-expo": "~8.0.0", 20 | "@babel/core": "^7.0.0" 21 | }, 22 | "private": true 23 | } 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-open-map", 3 | "version": "3.0.2", 4 | "description": "Choose the application that will open the map", 5 | "main": "src/index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/LucasMonteiro1/react-native-open-map.git" 9 | }, 10 | "scripts": { 11 | "lint": "eslint src/" 12 | }, 13 | "keywords": [ 14 | "React Native", 15 | "react-native", 16 | "react", 17 | "link", 18 | "maps", 19 | "ios", 20 | "android" 21 | ], 22 | "author": "Lucas Monteiro", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/LucasMonteiro1/react-native-open-map/issues" 26 | }, 27 | "peerDependencies": { 28 | "react": "16.12.0", 29 | "react-native": "^0.61.5" 30 | }, 31 | "devDependencies": { 32 | "babel-eslint": "^10.0.3", 33 | "eslint": "^6.8.0", 34 | "eslint-plugin-import": "^2.20.0", 35 | "eslint-plugin-react": "^7.18.0", 36 | "react": "16.12.0", 37 | "react-native": "^0.61.5" 38 | }, 39 | "dependencies": { 40 | "prop-types": "^15.7.2", 41 | "react-native-actionsheet": "^2.4.2", 42 | "react-native-root-siblings": "^4.0.6" 43 | }, 44 | "homepage": "https://github.com/LucasMonteiro1/react-native-open-map#readme" 45 | } 46 | -------------------------------------------------------------------------------- /src/ActionSheet.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Linking } from 'react-native'; 3 | import ActionSheet from 'react-native-actionsheet'; 4 | import { getUrl } from './url'; 5 | 6 | export default class OpenMap extends Component { 7 | componentDidMount() { 8 | const { apps } = this.props; 9 | 10 | if (apps.length > 1) { 11 | this.ActionSheet.show(); 12 | } else if (apps.length === 1) { 13 | this.openApp(0); 14 | } 15 | } 16 | 17 | openApp = (index) => { 18 | const { apps, latitude, longitude, title } = this.props; 19 | const app = apps[index]; 20 | 21 | if (app) { 22 | const lat = parseFloat(latitude); 23 | const lng = parseFloat(longitude); 24 | 25 | const url = getUrl(app, lat, lng, title || 'Location'); 26 | if (url) { 27 | return Linking.openURL(url); 28 | } 29 | } 30 | } 31 | 32 | render() { 33 | const { apps, cancelText, actionSheetTitle, actionSheetMessage } = this.props; 34 | 35 | if (apps.length === 0) return null; 36 | const options = apps.map((app) => app.title); 37 | options.push(cancelText || 'Cancel'); 38 | 39 | return( 40 | this.ActionSheet = ref} 42 | options={options} 43 | title={actionSheetTitle} 44 | message={actionSheetMessage} 45 | cancelButtonIndex={options.length - 1} 46 | destructiveButtonIndex={options.length - 1} 47 | onPress={this.openApp} 48 | /> 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Apps.js: -------------------------------------------------------------------------------- 1 | /*global Promise*/ 2 | import { Platform, Linking } from 'react-native'; 3 | import { GoogleMaps, AppleMaps, CityMapper, Uber, Lyft, Transit, Waze, Moovit } from './img'; 4 | 5 | const apps = [ 6 | 7 | { name: 'waze', title: 'Waze', prefixe: 'waze://', icon: Waze }, 8 | 9 | ]; 10 | 11 | const isAppInstalled = (app) => { 12 | return new Promise((resolve) => { 13 | Linking.canOpenURL(app).then((result) => { 14 | resolve(!!result); 15 | }).catch(() => { 16 | resolve(false); 17 | }); 18 | }); 19 | }; 20 | 21 | export const getApps = () => { 22 | const promises = apps.map((app) => isAppInstalled(app.prefixe).then((ret) => (ret) ? app : null)); 23 | 24 | return Promise.all(promises).then((returnPromises) => { 25 | return returnPromises.filter((app) => (app)); 26 | }); 27 | }; 28 | -------------------------------------------------------------------------------- /src/img/apple-maps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umer17/react-native-open-map/7195ff5455fbe459bad69715baf39b6a8eb5ae69/src/img/apple-maps.png -------------------------------------------------------------------------------- /src/img/citymapper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umer17/react-native-open-map/7195ff5455fbe459bad69715baf39b6a8eb5ae69/src/img/citymapper.png -------------------------------------------------------------------------------- /src/img/google-maps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umer17/react-native-open-map/7195ff5455fbe459bad69715baf39b6a8eb5ae69/src/img/google-maps.png -------------------------------------------------------------------------------- /src/img/index.js: -------------------------------------------------------------------------------- 1 | export { default as GoogleMaps } from './google-maps.png'; 2 | export { default as AppleMaps } from './apple-maps.png'; 3 | export { default as CityMapper } from './citymapper.png'; 4 | export { default as Uber } from './uber.png'; 5 | export { default as Lyft } from './lyft.png'; 6 | export { default as Transit } from './transit.png'; 7 | export { default as Waze } from './waze.png'; 8 | export { default as Moovit } from './moovit.png'; 9 | -------------------------------------------------------------------------------- /src/img/lyft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umer17/react-native-open-map/7195ff5455fbe459bad69715baf39b6a8eb5ae69/src/img/lyft.png -------------------------------------------------------------------------------- /src/img/moovit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umer17/react-native-open-map/7195ff5455fbe459bad69715baf39b6a8eb5ae69/src/img/moovit.png -------------------------------------------------------------------------------- /src/img/transit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umer17/react-native-open-map/7195ff5455fbe459bad69715baf39b6a8eb5ae69/src/img/transit.png -------------------------------------------------------------------------------- /src/img/uber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umer17/react-native-open-map/7195ff5455fbe459bad69715baf39b6a8eb5ae69/src/img/uber.png -------------------------------------------------------------------------------- /src/img/waze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/umer17/react-native-open-map/7195ff5455fbe459bad69715baf39b6a8eb5ae69/src/img/waze.png -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import RootSiblings from 'react-native-root-siblings'; 3 | import ActionSheet from './ActionSheet'; 4 | import { getApps } from './Apps'; 5 | 6 | class OpenMapManager { 7 | constructor() { 8 | this.props = []; 9 | 10 | getApps().then((apps) => { 11 | this.props.apps = apps; 12 | }); 13 | } 14 | 15 | setCurrent(props, callback = () => {}) { 16 | if (!props) return; 17 | 18 | this.currentManager = new RootSiblings(); 19 | } 20 | 21 | create(props, callback = () => {}) { 22 | this.setCurrent(props, callback); 23 | this.props.push(props); 24 | } 25 | 26 | update = (props) => { 27 | this.props[this.props.length - 1] = props; 28 | this.currentManager.update(); 29 | } 30 | 31 | show = (options) => { 32 | this.create({ ...this.props, ...options }); 33 | } 34 | } 35 | 36 | export default new OpenMapManager(); 37 | -------------------------------------------------------------------------------- /src/url.js: -------------------------------------------------------------------------------- 1 | export const getUrl = (app, lat, lng, title) => { 2 | if (app.name === 'apple-maps') { 3 | return `${app.prefixe}?ll=${lat},${lng}&q=${encodeURIComponent(title)}`; 4 | } 5 | if (app.name === 'google-maps') { 6 | return `${app.prefixe}?q=${lat},${lng}`; 7 | } 8 | if (app.name === 'citymapper') { 9 | return `${app.prefixe}directions?endcoord=${lat},${lng}&endname=${encodeURIComponent(title)}`; 10 | } 11 | if (app.name === 'uber') { 12 | title = `&dropoff[nickname]=${encodeURIComponent(title)}`; 13 | return `${app.prefixe}?action=setPickup&client_id=tDROEA84DI_9D2djgOt3L_JFCRAYTcvkB1m8RjO0&pickup=my_location&dropoff[latitude]=${lat}&dropoff[longitude]=${lng}${title}`; 14 | } 15 | if (app.name === 'lyft') { 16 | return `${app.prefixe}ridetype?id=lyft&destination[latitude]=${lat}&destination[longitude]=${lng}`; 17 | } 18 | if (app.name === 'transit') { 19 | return `${app.prefixe}directions?to=${lat},${lng}`; 20 | } 21 | if (app.name === 'waze') { 22 | return `${app.prefixe}?ll=${lat},${lng}&navigate=yes`; 23 | } 24 | if (app.name === 'moovit') { 25 | return `${app.prefixe}directions?dest_lat=${lat}&dest_lon${lng}&dest_name=${encodeURIComponent(title)}`; 26 | } 27 | }; 28 | --------------------------------------------------------------------------------