expo-gaode-map-search 1.3.10 → 1.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/build.gradle
CHANGED
|
@@ -29,6 +29,11 @@ if (useManagedAndroidSdkVersions) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
logger.warn("[expo-gaode-map-search] Thank you for using expo-gaode-map-search ❤️")
|
|
33
|
+
logger.warn("[expo-gaode-map-search] If you enjoy using expo-gaode-map-search, please consider sponsoring this project: https://github.com/TomWq")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
32
37
|
android {
|
|
33
38
|
namespace "expo.modules.gaodemap.search"
|
|
34
39
|
defaultConfig {
|
|
@@ -68,10 +68,5 @@ declare class ExpoGaodeMapSearchModuleType {
|
|
|
68
68
|
*/
|
|
69
69
|
getPoiDetail(id: string): Promise<POI>;
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*
|
|
74
|
-
* 提供 POI 搜索、周边搜索、沿途搜索、多边形搜索和输入提示功能
|
|
75
|
-
*/
|
|
76
|
-
declare const ExpoGaodeMapSearchModule: ExpoGaodeMapSearchModuleType;
|
|
77
|
-
export default ExpoGaodeMapSearchModule;
|
|
71
|
+
declare const _default: ExpoGaodeMapSearchModuleType;
|
|
72
|
+
export default _default;
|
|
@@ -22,11 +22,28 @@ function ensureBaseInstalled() {
|
|
|
22
22
|
throw new Error(msg);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
ensureBaseInstalled();
|
|
26
25
|
/**
|
|
27
26
|
* 高德地图搜索模块
|
|
28
27
|
*
|
|
29
28
|
* 提供 POI 搜索、周边搜索、沿途搜索、多边形搜索和输入提示功能
|
|
30
29
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
let nativeModuleCache = null;
|
|
31
|
+
function getNativeModule() {
|
|
32
|
+
ensureBaseInstalled();
|
|
33
|
+
if (!nativeModuleCache) {
|
|
34
|
+
nativeModuleCache = (0, expo_modules_core_1.requireNativeModule)('ExpoGaodeMapSearch');
|
|
35
|
+
}
|
|
36
|
+
return nativeModuleCache;
|
|
37
|
+
}
|
|
38
|
+
function getBoundNativeValue(module, prop) {
|
|
39
|
+
const value = Reflect.get(module, prop, module);
|
|
40
|
+
if (typeof value === 'function') {
|
|
41
|
+
return (...args) => value.apply(module, args);
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
exports.default = new Proxy({}, {
|
|
46
|
+
get(_target, prop) {
|
|
47
|
+
return getBoundNativeValue(getNativeModule(), prop);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -2,6 +2,9 @@ require 'json'
|
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
4
|
|
|
5
|
+
Pod::UI.puts "[expo-gaode-map-search] Thank you for using expo-gaode-map-search ❤️"
|
|
6
|
+
Pod::UI.puts "[expo-gaode-map-search] If you enjoy using expo-gaode-map-search, please consider sponsoring this project: https://github.com/TomWq"
|
|
7
|
+
|
|
5
8
|
Pod::Spec.new do |s|
|
|
6
9
|
s.name = 'ExpoGaodeMapSearch'
|
|
7
10
|
s.version = package['version']
|
package/package.json
CHANGED
|
@@ -37,8 +37,6 @@ function ensureBaseInstalled() {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
ensureBaseInstalled();
|
|
41
|
-
|
|
42
40
|
declare class ExpoGaodeMapSearchModuleType {
|
|
43
41
|
/**
|
|
44
42
|
* 初始化搜索模块(可选)
|
|
@@ -114,6 +112,30 @@ declare class ExpoGaodeMapSearchModuleType {
|
|
|
114
112
|
*
|
|
115
113
|
* 提供 POI 搜索、周边搜索、沿途搜索、多边形搜索和输入提示功能
|
|
116
114
|
*/
|
|
117
|
-
|
|
115
|
+
let nativeModuleCache: ExpoGaodeMapSearchModuleType | null = null;
|
|
116
|
+
|
|
117
|
+
function getNativeModule(): ExpoGaodeMapSearchModuleType {
|
|
118
|
+
ensureBaseInstalled();
|
|
119
|
+
if (!nativeModuleCache) {
|
|
120
|
+
nativeModuleCache = requireNativeModule<ExpoGaodeMapSearchModuleType>('ExpoGaodeMapSearch');
|
|
121
|
+
}
|
|
122
|
+
return nativeModuleCache;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function getBoundNativeValue(
|
|
126
|
+
module: ExpoGaodeMapSearchModuleType,
|
|
127
|
+
prop: PropertyKey
|
|
128
|
+
): unknown {
|
|
129
|
+
const value = Reflect.get(module as object, prop, module as object);
|
|
130
|
+
if (typeof value === 'function') {
|
|
131
|
+
return (...args: unknown[]) =>
|
|
132
|
+
(value as (...fnArgs: unknown[]) => unknown).apply(module, args);
|
|
133
|
+
}
|
|
134
|
+
return value;
|
|
135
|
+
}
|
|
118
136
|
|
|
119
|
-
export default
|
|
137
|
+
export default new Proxy({} as ExpoGaodeMapSearchModuleType, {
|
|
138
|
+
get(_target, prop) {
|
|
139
|
+
return getBoundNativeValue(getNativeModule(), prop);
|
|
140
|
+
},
|
|
141
|
+
});
|