bramus / react-native-maps-directions

Directions Component for `react-native-maps`
MIT License
1.25k stars 197 forks source link

Fix for timePrecison #199

Open coawazie opened 2 years ago

coawazie commented 2 years ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-maps-directions@1.8.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-maps-directions/index.d.ts b/node_modules/react-native-maps-directions/index.d.ts
index 8d0a9ec..58c1a7d 100644
--- a/node_modules/react-native-maps-directions/index.d.ts
+++ b/node_modules/react-native-maps-directions/index.d.ts
@@ -88,7 +88,7 @@ declare module "react-native-maps-directions" {
      * Allowed values are "none", and "now".
      * Defaults to "none"
      */
-    timePrecision?: MapViewDirectionsPrecision;
+    timePrecision?: MapViewDirectionsTimePrecision;
     /**
      * If you include the channel parameter in your requests,
      * you can generate a Successful Requests report that shows a breakdown
diff --git a/node_modules/react-native-maps-directions/src/MapViewDirections.js b/node_modules/react-native-maps-directions/src/MapViewDirections.js
index ac08d73..1ed30a2 100644
--- a/node_modules/react-native-maps-directions/src/MapViewDirections.js
+++ b/node_modules/react-native-maps-directions/src/MapViewDirections.js
@@ -1,6 +1,8 @@
 import React, { Component } from 'react';
 import PropTypes from 'prop-types';
 import MapView from 'react-native-maps';
+import { Polyline } from 'react-native-maps';
+
 import isEqual from 'lodash.isequal';

 const WAYPOINT_LIMIT = 10;
@@ -305,7 +307,7 @@ class MapViewDirections extends Component {
        } = this.props;

        return (
-           <MapView.Polyline coordinates={coordinates} {...props} />
+           <Polyline coordinates={coordinates} {...props} />
        );
    }

This issue body was partially generated by patch-package.