{"id":14974282,"url":"https://github.com/tiaanduplessis/react-native-google-maps-directions","last_synced_at":"2025-04-05T13:06:11.429Z","repository":{"id":45689141,"uuid":"82188633","full_name":"tiaanduplessis/react-native-google-maps-directions","owner":"tiaanduplessis","description":"🚕 Get direction using Google Maps in React Native 🚗","archived":false,"fork":false,"pushed_at":"2022-07-14T22:49:49.000Z","size":1393,"stargazers_count":182,"open_issues_count":8,"forks_count":28,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T12:05:37.683Z","etag":null,"topics":["directions","google-maps-api","react-native-app"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiaanduplessis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-16T14:21:43.000Z","updated_at":"2024-10-28T05:52:33.000Z","dependencies_parsed_at":"2022-07-30T18:38:05.627Z","dependency_job_id":null,"html_url":"https://github.com/tiaanduplessis/react-native-google-maps-directions","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Freact-native-google-maps-directions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Freact-native-google-maps-directions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Freact-native-google-maps-directions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Freact-native-google-maps-directions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiaanduplessis","download_url":"https://codeload.github.com/tiaanduplessis/react-native-google-maps-directions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339155,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["directions","google-maps-api","react-native-app"],"created_at":"2024-09-24T13:50:20.259Z","updated_at":"2025-04-05T13:06:11.404Z","avatar_url":"https://github.com/tiaanduplessis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚚 react-native-google-maps-directions 🚲\n\n\u003e 🚕 Get direction using Google Maps in React Native 🚗\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/tiaanduplessis/react-native-google-maps-directions.svg)](https://greenkeeper.io/)\n[![npm version](https://img.shields.io/npm/v/react-native-google-maps-directions.svg?style=flat-square)](https://npmjs.org/package/react-native-google-maps-directions)\n[![Downloads](https://img.shields.io/npm/dm/react-native-google-maps-directions.svg?style=flat-square)](https://npmjs.org/package/react-native-google-maps-directions)\n[![Standard](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n[![Travis Build](https://img.shields.io/travis/tiaanduplessis/react-native-google-maps-directions/master.svg?style=flat-square)](https://travis-ci.org/tiaanduplessis/react-native-google-maps-directions)\n\n## Table of Contents\n\n- [About](#about)\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Contribute](#Contribute)\n- [License](#license)\n\n## About\n\nA tiny module that uses the [React Native Linking API](https://facebook.github.io/react-native/docs/linking.html) to get directions using [Google Maps](https://www.google.com/maps) by opening it in the default browser or app if installed.\n\n## Install\n\n```sh\n$ npm install --save react-native-google-maps-directions\n```\n\n```sh\n$ yarn add react-native-google-maps-directions\n```\n\n## Usage\n\n```js\nimport getDirections from 'react-native-google-maps-directions'\n\nexport default class gmapsDirections extends Component {\n\n  handleGetDirections = () =\u003e {\n    const data = {\n       source: {\n        latitude: -33.8356372,\n        longitude: 18.6947617\n      },\n      destination: {\n        latitude: -33.8600024,\n        longitude: 18.697459\n      },\n      params: [\n        {\n          key: \"travelmode\",\n          value: \"driving\"        // may be \"walking\", \"bicycling\" or \"transit\" as well\n        },\n        {\n          key: \"dir_action\",\n          value: \"navigate\"       // this instantly initializes navigation using the given travel mode\n        }\n      ],\n      waypoints: [\n        {\n          latitude: -33.8600025,\n          longitude: 18.697452\n        },\n        {\n          latitude: -33.8600026,\n          longitude: 18.697453\n        },\n           {\n          latitude: -33.8600036,\n          longitude: 18.697493\n        }\n      ]\n    }\n\n    getDirections(data)\n  }\n\n  render() {\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cButton onPress={this.handleGetDirections} title=\"Get Directions\" /\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n```\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./media/demo.gif\" alt=\"Demo usage\" /\u003e\n\u003c/div\u003e\n\n## API\n\nThe module exports a single `getDirections` function that takes a object as its argument. The object may have `destination` (Where you're going to) and `source` (Where you're coming from) both of which have `latitude` and `longitude` number properties. If `source` is undefined, it defaults to the user's current location. If `destination` is undefined, it leaves it blank in Google Maps and the user will be able to enter a destination.\n\nAdditionaly parameters can be added as key-value pairs to the params array (optional). The supported parameters are listed [here](https://developers.google.com/maps/documentation/urls/guide#directions-action).\n\n### Waypoints\n\nWaypoints should be passed as an array of objects:\n\n```js\n[\n        {\n          latitude: -33.8600025,\n          longitude: 18.697452,\n        },\n        {\n          latitude: -33.8600026,\n          longitude: 18.697453,\n        }\n]\n```\n\n## Contribute\n\nContributions are welcome. Please open up an issue or create PR if you would like to help out.\n\nNote: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\nLicensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Freact-native-google-maps-directions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiaanduplessis%2Freact-native-google-maps-directions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Freact-native-google-maps-directions/lists"}