问题
I building a react-native app in which i have used map to show certain locations. I have marked pins for each location on map. Now i want that if user select a marker and click on navigation button(which i have provided on map) it should launch apple map(for ios) and google maps(for android) and show navigation from user's current location to the latitude and longitude that i have passed in the map url.
But on apple maps it always show "direction not available" message.
Here is how i call map url for navigation:
Platform.select({
ios: () => {
Linking.openURL('http://maps.apple.com/maps?daddr='+latitude+','+longitude+'&dirflg=d&t=m');
},
android: () => {
Linking.openURL('http://maps.google.com/maps?daddr=' +latitude+ ',' +longitude);
}
})();
Can anyone please help me out here..
Thanks
回答1:
Currently directions feature is not available in India because of this map is not showing you directions. You have to use Google Map.
For more clarification follow this link
https://www.apple.com/in/ios/feature-availability/#maps-directions
This link shows which feature is available in which country.
来源:https://stackoverflow.com/questions/47808584/apple-maps-shows-directions-not-available-when-launched-from-react-native-app