One `npm publish` away from releasing version 1.5.0 of `react-native-maps-directions` :) πŸ”—

One `npm publish` away from releasing version 1.5.0 of `react-native-maps-directions` :)

πŸ”—

  • Directions component for – Draw a route between two coordinates, powered by the Google Maps Directions API – – Import and render it as a child of a component.
  • The mandatory props are: – – Once the directions in between and has been fetched, a between the two will be drawn.
  • Since the result rendered on screen is a component, all props – except for – are also accepted.
  • The values for the and props can take several forms.
  • They can either be: – – All examples below have the same location, represented in the formats mentioned above: – – Note: The and props don’t need to use the same representation, you may mix them.

react-native-maps-directions – Directions Component for `react-native-maps`

GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.

– Draw a route between two coordinates, powered by the Google Maps Directions API

props are:

import MapViewDirections from ‘react-native-maps-directions’; const origin = {latitude: 37.3318456, longitude: – 122.0296002}; const destination = {latitude: 37.771707, longitude: – 122.4053769}; const GOOGLE_MAPS_APIKEY = ‘…’; < /MapView>

between the two will be drawn.

– are also accepted.

< /MapView>

props can take several forms. They can either be:

location, represented in the formats mentioned above:

props don’t need to use the same representation, you may mix them.

prop when using localized location names.

This example will draw a route between AirBnB’s Office and Apple’s HQ

import React, { Component } from ‘react’; import { Dimensions, StyleSheet } from ‘react-native’; import MapView from ‘react-native-maps’; import MapViewDirections from ‘react-native-maps-directions’; const { width, height } = Dimensions.get(‘window’); const ASPECT_RATIO = width /…

GitHub