diff --git a/example/home.tsx b/example/home.tsx index efe24411..54241c4d 100644 --- a/example/home.tsx +++ b/example/home.tsx @@ -1,7 +1,6 @@ import { useNavigation, useTheme } from "@react-navigation/native"; import * as React from "react"; import { - Constructor, Platform, ScrollView, StyleSheet, @@ -11,6 +10,7 @@ import { View, } from "react-native"; import { AMapSdk } from "react-native-amap3d"; +import { Constructor } from "react-native/private/Utilities"; import screens from "./screens"; import { NavigationProps, ScreenName } from "./types"; diff --git a/example/screens/animated.tsx b/example/screens/animated.tsx index abcb9e88..02199308 100644 --- a/example/screens/animated.tsx +++ b/example/screens/animated.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Dimensions, StyleSheet, Text, TouchableOpacity, View } from "react-native"; +import { Dimensions, PixelRatio, StyleSheet, Text, TouchableOpacity, View } from "react-native"; import { MapView } from "react-native-amap3d"; let mapView: MapView; @@ -11,6 +11,7 @@ export default () => ( { + console.log(Dimensions.get("window").width); mapView?.moveCamera( { tilt: 45, @@ -49,7 +50,7 @@ export default () => ( const style = StyleSheet.create({ body: { flex: 1 }, buttons: { - width: Dimensions.get("window").width, + width: "100%", position: "absolute", flexDirection: "row", justifyContent: "center", diff --git a/lib/android/build.gradle b/lib/android/build.gradle index 7d0af540..a6e84de6 100644 --- a/lib/android/build.gradle +++ b/lib/android/build.gradle @@ -6,7 +6,7 @@ def getExt(prop, fallback) { } buildscript { - ext.kotlin_version = '1.5.31' + ext.kotlin_version = '1.7.21' repositories { mavenCentral() @@ -18,27 +18,17 @@ buildscript { } android { - compileSdkVersion getExt('compileSdkVersion', 30) - buildToolsVersion getExt('buildToolsVersion', '30.0.2') + compileSdkVersion getExt('compileSdkVersion', 33) + buildToolsVersion getExt('buildToolsVersion', '33.0.0') defaultConfig { minSdkVersion getExt('minSdkVersion', 21) - targetSdkVersion getExt('targetSdkVersion', 30) - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' + targetSdkVersion getExt('targetSdkVersion', 33) } } dependencies { - api 'com.facebook.react:react-native:+' + compileOnly 'com.facebook.react:react-native:+' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.amap.api:3dmap:9.6.0' - implementation 'com.amap.api:location:6.1.0' } diff --git a/lib/ios/react-native-amap3d.podspec b/lib/ios/react-native-amap3d.podspec deleted file mode 100644 index 964bd255..00000000 --- a/lib/ios/react-native-amap3d.podspec +++ /dev/null @@ -1,20 +0,0 @@ -require "json" - -package = JSON.parse(File.read(File.join(__dir__, "../../package.json"))) - -Pod::Spec.new do |s| - s.name = "react-native-amap3d" - s.version = package["version"] - s.summary = package["description"] - s.homepage = package["homepage"] - s.license = package["license"] - s.authors = package["author"] - - s.platforms = { :ios => "10.0" } - s.source = { :git => "https://github.com/qiuxiang/react-native-amap3d.git", :tag => "#{s.version}" } - - s.source_files = "**/*.{h,m,mm,swift}" - - s.dependency "React-Core" - s.dependency 'AMap3DMap', "~> 9.5.0" -end diff --git a/license b/license index b63749fb..121f2772 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 7c00 +Copyright (c) 2023 7c00 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index c9ed6ced..0a43b856 100644 --- a/package.json +++ b/package.json @@ -35,15 +35,15 @@ "supercluster": "^7.1.4" }, "devDependencies": { - "@react-native-picker/picker": "^2.1.0", - "@react-navigation/native": "^6.0.6", - "@react-navigation/native-stack": "^6.0.11", - "@types/react-native": "^0.65.8", - "@types/supercluster": "^5.0.3", - "react": "17.0.2", - "react-native": "^0.66.3", - "react-native-safe-area-context": "^3.3.2", - "react-native-screens": "^3.8.0" + "@react-native-picker/picker": "^2.4.8", + "@react-navigation/native": "^6.1.3", + "@react-navigation/native-stack": "^6.9.9", + "@types/react-native": "^0.71.2", + "@types/supercluster": "^7.1.0", + "react": "18.2.0", + "react-native": "^0.71.2", + "react-native-safe-area-context": "^4.5.0", + "react-native-screens": "^3.19.0" }, "prettier": { "printWidth": 100 diff --git a/react-native-amap3d.podspec b/react-native-amap3d.podspec index fcbe949d..8fad742d 100644 --- a/react-native-amap3d.podspec +++ b/react-native-amap3d.podspec @@ -16,5 +16,5 @@ Pod::Spec.new do |s| s.source_files = "lib/ios/**/*.{h,m,mm,swift}" s.dependency "React-Core" - s.dependency 'AMap3DMap', "~> 9.2.1" + s.dependency 'AMap3DMap', "~> 9.5.0" end diff --git a/react-native.config.js b/react-native.config.js index 28d2cbc5..e7c113cb 100644 --- a/react-native.config.js +++ b/react-native.config.js @@ -4,7 +4,6 @@ module.exports = { "react-native-amap3d": { root: __dirname, platforms: { - ios: { podspecPath: __dirname + "/lib/ios/react-native-amap3d.podspec" }, android: { sourceDir: __dirname + "/lib/android", packageImportPath: "import qiuxiang.amap3d.AMap3DPackage;",