Apple maps shows “directions not available” when launched from react-native app

折月煮酒 提交于 2019-12-24 01:19:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!