Skip to content

qwaszx99/react-native-webview-amap-demo

 
 

Repository files navigation

react-native-webview-amap-demo

react native高德地图拖拽定位demo,使用webview实现。

只需要明白react native如何与webview通信,web端能实现的功能基本可以用在react native上,文档参考react native webview高德地图JavaScript API

安装

  • git clone https://github.com/z372183629/react-native-webview-amap-demo.git
  • cd react-native-webview-amap-demo
  • npm install

更新

  • 2019-08-06 本项目RN版本升至0.57.8

注意

xcode10编译问题

xcode 10在编译React Native 0.57以下版本时会出现问题。

首先,在项目根目录执行下面的命令

  • cd node_modules/react-native/third-party/glog-0.3.4
  • ./configure

执行上面两个命令后,再次编译如果出现下面的错误

No member named '__rip' in '__darwin_arm_thread_state64'

编辑node_modules/react-native/third-party/glog-0.3.4/src/config.h
找到

/* How to access the PC from a struct ucontext */
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip

替换成

/* How to access the PC from a struct ucontext */
#if defined(__arm__) || defined(__arm64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__pc
#else
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#endif

解决方案参考链接:

效果图

Alt Text

About

react native高德地图拖拽定位demo,使用webview实现

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 43.5%
  • HTML 30.4%
  • Objective-C 15.1%
  • Python 5.9%
  • Java 5.1%