Closed german-bortoli closed 6 years ago
Hi @Germanaz0, have you set a strokeWidth
or strokeColor
prop?
Hi @bramus yes both, I can see it properly on Android but not on iOS :S
Hmmz, That's weird indeed. Let's see:
react-native
and react-native-maps
are you using?<MapView.Polyline />
yourself?react-native: 0.50.3 react-native-maps
About the second question, am not pretty sure, I can view the markers, I have to run a test, I can give you that information in a few of hours.
Yes if I draw a polyline in the same state, it does works, but does not using the package.
Perhaps there's no route available between the two points? Could you share those coordinates? Then I can test myself (and provide a fallback in case that happens).
Additionally, for testing, what happens when you enter the coordinates from the example?
const origin = {latitude: 37.3318456, longitude: -122.0296002};
const destination = {latitude: 37.771707, longitude: -122.4053769};
me too, it's work fine in android with same coordinates
@hatyaiapp I'll need some more info:
react-native
are you using?react-native-maps
are you using?B!
@bramus
{latitude: 37.3318456, longitude: -122.0296002}
and
{latitude: 37.771707, longitude: -122.4053769}
OK, I have a working combo of RN 0.53 and react-native-maps
0.16.4 here (the version before it was handed over from AirBnB by the React Community). Will need to check what 0.20 gives me.
I've now tested react-native-maps-directions
with the following react-native
and react-native-maps
combinations:
They all work fine (iPhone 8 Plus, iOS 11.2, MapKit, Simulator) …
Can someone provide me some demo code (or a repo) that reproduces this problem?
@bramus could be that this wont work if it is a child component of the map, and has some conditions to be rendered ?
What I do not understand is why on android works fine
As I cannot reproduce it: can you share a standalone piece of code in which things go wrong? Without it I won't be able to do that much and will be closing this issue some time in the future …
Yes, I need a bit of time only to generate a seed or something
Awesome! Looking forward to it :)
Closing due to inactivity / insufficient information.
Feel free to add some more info and I'll gladly reopen.
I'm not able to draw a route on iPhone either. Android device works fine. That's my code and I see only a marker:
<View>
<MapViewDirections
origin={this.getEndPoint()}
destination={this.state.destination}
apikey={Keys.DirectionsApiKey}
strokeWidth={4}
strokeColor="#000"
mode={'walking'}
<MapView.Marker coordinate={this.state.destination} anchor={{x: 0.42, y: 0.49}}>
<View style={styles.routeEnd}></View>
</MapView.Marker>
</View>
This code
<MapView.Polyline
coordinates={this.getRideTracks()}
strokeColor="#FF1943"
strokeWidth={4}
/>
inside my MapView component works fine
@Bramus What is the free amount of directions that can be performed without the new Google API paid Application KEY ? When I try to do directions I see an error that something went wrong and the direction cannot be loaded.
@veselinnguyen See Google's own Directions API Usage and Billing page for info on their pricing.
I know it's old and closed, but I had the same issue. Basically you can't wrap the Map Directions in a View on iOS. https://github.com/bramus/react-native-maps-directions/issues/113
Thanks @koo27!!!
Thank you @koo27 !
I am unable to see directions on iOS, I am using a child element on parent map, to generate markers and get them directions.
Somehow it shows me the markers but not the directions (Btw onReady event works perfectly)