Skip to content

Instantly share code, notes, and snippets.

@princessjanf
Created December 4, 2017 15:27
Show Gist options
  • Save princessjanf/d4ab9177a91da8c4909aabd0a0f956be to your computer and use it in GitHub Desktop.
Save princessjanf/d4ab9177a91da8c4909aabd0a0f956be to your computer and use it in GitHub Desktop.
View polyline from google directions api
render() {
return (
<MapView style={styles.map} initialRegion={{
latitude:-6.270565,
longitude:106.759550,
latitudeDelta: 1,
longitudeDelta: 1
}}>
<MapView.Polyline
coordinates={this.state.coords}
strokeWidth={2}
strokeColor="red"/>
</MapView>
);
}
}
const styles = StyleSheet.create({
map: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment