Commit af65ab50 authored by 7c00's avatar 7c00

Update dependencies

parent 10b3f19c
...@@ -22,7 +22,7 @@ aliases: ...@@ -22,7 +22,7 @@ aliases:
| |
nvm install node nvm install node
yarn global add react-native-cli yarn global add react-native-cli
react-native init App react-native init App --version="0.52.3"
cd App cd App
yarn add react-native-amap3d yarn add react-native-amap3d
...@@ -86,10 +86,18 @@ jobs: ...@@ -86,10 +86,18 @@ jobs:
cat << EOF > Podfile cat << EOF > Podfile
platform :ios, '8.0' platform :ios, '8.0'
target 'App' do target 'App' do
pod 'React', path: '../node_modules/react-native', :subspecs => [ pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport', 'DevSupport',
'RCTText',
'RCTNetwork',
'RCTWebSocket',
] ]
pod 'yoga', path: '../node_modules/react-native/ReactCommon/yoga' pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'react-native-amap3d', path: '../node_modules/react-native-amap3d/lib/ios' pod 'react-native-amap3d', path: '../node_modules/react-native-amap3d/lib/ios'
end end
EOF EOF
......
...@@ -4,7 +4,7 @@ react-native 高德地图组件,使用最新 3D SDK,支持 Android + iOS, ...@@ -4,7 +4,7 @@ react-native 高德地图组件,使用最新 3D SDK,支持 Android + iOS,
如果你需要百度地图,推荐使用 [react-native-baidumap-sdk](https://github.com/qiuxiang/react-native-baidumap-sdk) 如果你需要百度地图,推荐使用 [react-native-baidumap-sdk](https://github.com/qiuxiang/react-native-baidumap-sdk)
*注意:RN v0.53 存在一些 bug(主要影响 iOS),建议使用 RN v0.52。* *注意:RN v0.53+ 存在一些 bug(主要影响 iOS 自定义 View),建议使用 RN v0.52。*
## 功能 ## 功能
...@@ -48,17 +48,36 @@ $ react-native link react-native-amap3d ...@@ -48,17 +48,36 @@ $ react-native link react-native-amap3d
推荐使用 CocoaPods,需要注意 iOS 项目不要 `react-native link react-native-amap3d`, 不然会引入错误的依赖,导致编译失败。在 `ios` 目录下新建文件 `Podfile` 推荐使用 CocoaPods,需要注意 iOS 项目不要 `react-native link react-native-amap3d`, 不然会引入错误的依赖,导致编译失败。在 `ios` 目录下新建文件 `Podfile`
```ruby ```ruby
platform :ios, '8.0' platform :ios, '8.0'
# The target name is most likely the name of your project.
target 'Your Target' do target 'Your Target' do
pod 'yoga', path: '../node_modules/react-native/ReactCommon/yoga/' # Your 'node_modules' directory is probably in the root of your project,
pod 'React', path: '../node_modules/react-native/', :subspecs => [ # but if not, adjust the `:path` accordingly
'DevSupport', pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # Include this for RN >= 0.47
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
# Add any other subspecs you want to use in your project
] ]
pod 'react-native-amap3d', path: '../node_modules/react-native-amap3d/lib/ios/' # Explicitly include Yoga if you are using RN >= 0.42.0
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'react-native-amap3d', path: '../lib/ios/'
end end
``` ```
*注意:不同的 RN 版本,`Podfile` 可能需要稍作调整,具体参考 https://facebook.github.io/react-native/docs/0.52/integration-with-existing-apps.html 。*
然后运行: 然后运行:
``` ```
$ pod install $ pod install
......
platform :ios, '8.0' platform :ios, '8.0'
# The target name is most likely the name of your project.
target 'RNAMap3D' do target 'RNAMap3D' do
pod 'React', path: '../node_modules/react-native/', :subspecs => [ # Your 'node_modules' directory is probably in the root of your project,
'DevSupport', # but if not, adjust the `:path` accordingly
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # Include this for RN >= 0.47
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
# Add any other subspecs you want to use in your project
] ]
pod 'yoga', path: '../node_modules/react-native/ReactCommon/yoga/' # Explicitly include Yoga if you are using RN >= 0.42.0
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'react-native-amap3d', path: '../lib/ios/' pod 'react-native-amap3d', path: '../lib/ios/'
end end
...@@ -26,6 +26,6 @@ android { ...@@ -26,6 +26,6 @@ android {
dependencies { dependencies {
provided 'com.facebook.react:react-native:+' provided 'com.facebook.react:react-native:+'
compile 'com.amap.api:navi-3dmap:5.3.0_3dmap5.3.0' compile 'com.amap.api:navi-3dmap:6.0.1_3dmap6.1.0'
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
} }
...@@ -56,8 +56,11 @@ class AMapView(context: Context) : TextureMapView(context) { ...@@ -56,8 +56,11 @@ class AMapView(context: Context) : TextureMapView(context) {
} }
map.setOnMarkerClickListener { marker -> map.setOnMarkerClickListener { marker ->
emit(markers[marker.id]?.id, "onPress") markers[marker.id]?.let {
false it.active = true
emit(it.id, "onPress")
}
true
} }
map.setOnMarkerDragListener(object : AMap.OnMarkerDragListener { map.setOnMarkerDragListener(object : AMap.OnMarkerDragListener {
......
...@@ -133,9 +133,6 @@ abstract class AMapNavigation(context: ThemedReactContext) : ...@@ -133,9 +133,6 @@ abstract class AMapNavigation(context: ThemedReactContext) :
override fun OnUpdateTrafficFacility(p0: TrafficFacilityInfo?) { override fun OnUpdateTrafficFacility(p0: TrafficFacilityInfo?) {
} }
override fun showLaneInfo(p0: Array<out AMapLaneInfo>?, p1: ByteArray?, p2: ByteArray?) {
}
override fun onNaviInfoUpdate(p0: NaviInfo?) { override fun onNaviInfoUpdate(p0: NaviInfo?) {
} }
...@@ -166,4 +163,19 @@ abstract class AMapNavigation(context: ThemedReactContext) : ...@@ -166,4 +163,19 @@ abstract class AMapNavigation(context: ThemedReactContext) :
override fun onNaviCancel() { override fun onNaviCancel() {
} }
override fun updateIntervalCameraInfo(p0: AMapNaviCameraInfo?, p1: AMapNaviCameraInfo?, p2: Int) {
}
override fun showModeCross(p0: AMapModelCross?) {
}
override fun hideModeCross() {
}
override fun showLaneInfo(p0: Array<out AMapLaneInfo>?, p1: ByteArray?, p2: ByteArray?) {
}
override fun showLaneInfo(p0: AMapLaneInfo?) {
}
} }
...@@ -16,5 +16,5 @@ Pod::Spec.new do |s| ...@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
s.source_files = '**/*.{h,m}' s.source_files = '**/*.{h,m}'
s.dependency 'React' s.dependency 'React'
s.dependency 'AMapNavi' s.dependency 'AMapNavi', "~> 6.0.0"
end end
...@@ -34,17 +34,17 @@ ...@@ -34,17 +34,17 @@
"react-native": ">=0.47" "react-native": ">=0.47"
}, },
"devDependencies": { "devDependencies": {
"babel-eslint": "^8.1.2", "babel-eslint": "^8.2.3",
"babel-preset-react-native": "^4.0.0", "babel-preset-react-native": "^4.0.0",
"eslint": "^4.18.0", "eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0", "eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.8.0", "eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3", "eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.5.1", "eslint-plugin-react": "^7.7.0",
"flow-bin": "^0.66.0", "flow-bin": "^0.69.0",
"react": "16.2.0", "react": "16.2.0",
"react-native": "0.52.2", "react-native": "0.52.3",
"react-navigation": "^1.0.3" "react-navigation": "^1.5.11"
}, },
"presets": [ "presets": [
"react-native" "react-native"
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment