提交 ff156633 authored 作者: 袁静春's avatar 袁静春

提交:修改传参方式;

上级 403fe0bf
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>9.0</string> <string>11.0</string>
</dict> </dict>
</plist> </plist>
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
# platform :ios, '9.0' # platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'
......
...@@ -25,9 +25,9 @@ EXTERNAL SOURCES: ...@@ -25,9 +25,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
AMapFoundation: f48153f724114b58da9b01875ab88a1f6856e3db AMapFoundation: f48153f724114b58da9b01875ab88a1f6856e3db
AMapSearch: 839b25de7af9d61b65266edf64382283b6af54a1 AMapSearch: 839b25de7af9d61b65266edf64382283b6af54a1
clx_map_poi_search: e73b453bb57e5436dc17af57f237c08d9b47909a clx_map_poi_search: 09cb40ccd7db9d9df5b4f3c0a885edddc8bcf746
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d PODFILE CHECKSUM: 663715e941f9adb426e33bf9376914006f9ea95b
COCOAPODS: 1.11.3 COCOAPODS: 1.11.3
...@@ -332,7 +332,7 @@ ...@@ -332,7 +332,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
...@@ -407,7 +407,7 @@ ...@@ -407,7 +407,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
...@@ -456,7 +456,7 @@ ...@@ -456,7 +456,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
......
...@@ -23,11 +23,15 @@ class _MyAppState extends State<MyApp> { ...@@ -23,11 +23,15 @@ class _MyAppState extends State<MyApp> {
setupData() async { setupData() async {
ClxMapPoiSearch.instance.initPoiSearch(AMapConfig.aMapApiKeys); ClxMapPoiSearch.instance.initPoiSearch(AMapConfig.aMapApiKeys);
var result = await ClxMapPoiSearch.instance.keywordsSearch("北京大学"); // var result = await ClxMapPoiSearch.instance.keywordsSearch("北京大学");
print("------ result: $result"); // print("------ result: $result");
//
// var result1 = await ClxMapPoiSearch.instance.aroundSearch(31.230378, 121.473658);
// print("------ result1: $result1");
var result2 = await ClxMapPoiSearch.instance.aroundSearchAll("北京大学");
print("------ result2: $result2");
var result1 = await ClxMapPoiSearch.instance.aroundSearch(31.230378, 121.473658);
print("------ result1: $result1");
} }
@override @override
......
...@@ -14,7 +14,7 @@ packages: ...@@ -14,7 +14,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.8.2" version: "2.9.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
...@@ -28,21 +28,14 @@ packages: ...@@ -28,21 +28,14 @@ packages:
name: characters name: characters
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.1"
clx_map_poi_search: clx_map_poi_search:
dependency: "direct main" dependency: "direct main"
description: description:
...@@ -70,7 +63,7 @@ packages: ...@@ -70,7 +63,7 @@ packages:
name: fake_async name: fake_async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.3.1"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
...@@ -101,28 +94,28 @@ packages: ...@@ -101,28 +94,28 @@ packages:
name: matcher name: matcher
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.11" version: "0.12.12"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.1.4" version: "0.1.5"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.7.0" version: "1.8.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.1" version: "1.8.2"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
...@@ -141,7 +134,7 @@ packages: ...@@ -141,7 +134,7 @@ packages:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.2" version: "1.9.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
...@@ -169,21 +162,21 @@ packages: ...@@ -169,21 +162,21 @@ packages:
name: string_scanner name: string_scanner
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.1"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.4.9" version: "0.4.12"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
......
...@@ -105,23 +105,51 @@ ...@@ -105,23 +105,51 @@
} }
- (void)aroundSearchAll:(NSDictionary *)arguments { - (void)aroundSearchAll:(NSDictionary *)arguments {
NSString *latitude = arguments[@"latitude"]; NSNumber *latitude = arguments[@"latitude"];
NSString *longitude = arguments[@"longitude"]; NSNumber *longitude = arguments[@"longitude"];
NSString *keywords = arguments[@"keywords"]; NSString *keywords = arguments[@"keywords"];
NSString *city = arguments[@"city"]; NSString *city = arguments[@"city"];
AMapPOIAroundSearchRequest *request = [[AMapPOIAroundSearchRequest alloc] init]; if ((latitude != nil && [latitude intValue] != 0) && (longitude != nil && [longitude intValue] != 0)) {
request.location = [AMapGeoPoint locationWithLatitude:[latitude floatValue] longitude:[longitude floatValue]]; NSLog(@"aroundSearchAll 经纬度不为0 - latitude:%@, longitude:%@", latitude, longitude);
request.page = 1;
request.offset = 20; AMapPOIAroundSearchRequest *request = [[AMapPOIAroundSearchRequest alloc] init];
request.radius = 1000; request.location = [AMapGeoPoint locationWithLatitude:[latitude floatValue] longitude:[longitude floatValue]];
if (keywords.length != 0) { request.page = 1;
request.keywords = keywords; request.offset = 20;
} request.radius = 1000;
if (city.length != 0) { if (keywords != nil && [keywords isKindOfClass:[NSNull class]]) {
request.city = city; if (keywords.length != 0) {
request.keywords = keywords;
}
}
if (city != nil && ![city isKindOfClass:[NSNull class]]) {
if (city.length != 0) {
request.city = city;
}
}
[self.search AMapPOIAroundSearch:request];
} else {
NSLog(@"aroundSearchAll 经纬度为0 - latitude:%@, longitude:%@", latitude, longitude);
AMapPOIKeywordsSearchRequest *request = [[AMapPOIKeywordsSearchRequest alloc] init];
if (keywords != nil && [keywords isKindOfClass:[NSNull class]]) {
if (keywords.length != 0) {
request.keywords = keywords;
}
}
if (city != nil && ![city isKindOfClass:[NSNull class]]) {
if (city.length != 0) {
request.city = city;
}
}
request.page = 1;
request.offset = 20;
//是否返回扩展信息
//request.requireExtension = YES;
[self.search AMapPOIKeywordsSearch:request];
} }
[self.search AMapPOIAroundSearch:request];
} }
#pragma mark - #pragma mark -
......
...@@ -28,7 +28,7 @@ class ClxMapPoiSearch { ...@@ -28,7 +28,7 @@ class ClxMapPoiSearch {
} }
/// 周边搜索 /// 周边搜索
Future<PoiResult?> aroundSearchAll(String keywords, double latitude, double longitude, String city) { Future<PoiResult?> aroundSearchAll(String keywords, { double? latitude = 0, double? longitude = 0, String? city }) {
return ClxMapPoiSearchPlatform.instance.aroundSearchAll(keywords, latitude, longitude, city); return ClxMapPoiSearchPlatform.instance.aroundSearchAll(keywords, latitude: latitude, longitude: longitude, city: city);
} }
} }
...@@ -43,7 +43,7 @@ class MethodChannelClxMapPoiSearch extends ClxMapPoiSearchPlatform { ...@@ -43,7 +43,7 @@ class MethodChannelClxMapPoiSearch extends ClxMapPoiSearchPlatform {
/// 周边搜索 /// 周边搜索
@override @override
Future<PoiResult?> aroundSearchAll(String keywords, double latitude, double longitude, String city) async { Future<PoiResult?> aroundSearchAll(String keywords, { double? latitude, double? longitude, String? city }) async {
var searchPOIResult = await methodChannel.invokeMethod<dynamic>('searchPOI#aroundAll', <String, dynamic>{ var searchPOIResult = await methodChannel.invokeMethod<dynamic>('searchPOI#aroundAll', <String, dynamic>{
'keywords': keywords, 'keywords': keywords,
'latitude': latitude, 'latitude': latitude,
......
...@@ -49,7 +49,7 @@ abstract class ClxMapPoiSearchPlatform extends PlatformInterface { ...@@ -49,7 +49,7 @@ abstract class ClxMapPoiSearchPlatform extends PlatformInterface {
} }
/// 周边搜索 /// 周边搜索
Future<PoiResult?> aroundSearchAll(String keywords, double latitude, double longitude, String city) async { Future<PoiResult?> aroundSearchAll(String keywords, { double? latitude, double? longitude, String? city, }) async {
throw UnimplementedError('aroundSearchAll() has not been implemented.'); throw UnimplementedError('aroundSearchAll() has not been implemented.');
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论