react本地开放地图库不起作用



当纬度和经度传递到这些库时,会对本地开放地图做出反应,而不会导航到地图应用程序,并且不会显示错误OpenMap.show({纬度:40.778721,经度:-73.968188,});

#使用此代码

if (Platform.OS === 'android') {
Linking.openURL(`geo:0,0?q=${latitude},${longitude}(${this.state.treeClicked.info})`)
.catch(err => console.error('An error occurred', err));
} else {
Linking.openURL(`http://maps.apple.com/?ll=${latitude},${longitude}&q=${this.state.treeClicked.info}`)
.catch(err => console.error('An error occurred', err));
}

最新更新