Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx_map_poi_search
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx_map_poi_search
Commits
4215f538
提交
4215f538
authored
12月 02, 2022
作者:
袁静春
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交:增加综合搜索的方法;
上级
fcc475e2
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
48 行增加
和
0 行删除
+48
-0
ClxMapPoiSearchPlugin.m
ios/Classes/ClxMapPoiSearchPlugin.m
+27
-0
clx_map_poi_search.dart
lib/clx_map_poi_search.dart
+5
-0
clx_map_poi_search_method_channel.dart
lib/core/clx_map_poi_search_method_channel.dart
+11
-0
clx_map_poi_search_platform_interface.dart
lib/core/clx_map_poi_search_platform_interface.dart
+5
-0
没有找到文件。
ios/Classes/ClxMapPoiSearchPlugin.m
浏览文件 @
4215f538
...
@@ -68,6 +68,13 @@
...
@@ -68,6 +68,13 @@
}
@catch
(
FlutterError
*
e
)
{
}
@catch
(
FlutterError
*
e
)
{
result
(
e
);
result
(
e
);
}
}
}
else
if
([
@"searchPOI#around#all"
isEqualToString
:
call
.
method
])
{
@try
{
NSLog
(
@"---handleMethodCall--- arguments:%@"
,
arguments
);
[
weakSelf
aroundSearchAll
:
arguments
];
}
@catch
(
FlutterError
*
e
)
{
result
(
e
);
}
}
else
if
([
@"getPlatformVersion"
isEqualToString
:
call
.
method
])
{
}
else
if
([
@"getPlatformVersion"
isEqualToString
:
call
.
method
])
{
result
([
@"iOS "
stringByAppendingString
:[[
UIDevice
currentDevice
]
systemVersion
]]);
result
([
@"iOS "
stringByAppendingString
:[[
UIDevice
currentDevice
]
systemVersion
]]);
}
else
{
}
else
{
...
@@ -94,6 +101,26 @@
...
@@ -94,6 +101,26 @@
[
self
.
search
AMapPOIAroundSearch
:
request
];
[
self
.
search
AMapPOIAroundSearch
:
request
];
}
}
-
(
void
)
aroundSearchAll
:(
NSDictionary
*
)
arguments
{
NSString
*
latitude
=
arguments
[
@"latitude"
];
NSString
*
longitude
=
arguments
[
@"longitude"
];
NSString
*
keywords
=
arguments
[
@"keywords"
];
NSString
*
city
=
arguments
[
@"city"
];
AMapPOIAroundSearchRequest
*
request
=
[[
AMapPOIAroundSearchRequest
alloc
]
init
];
request
.
location
=
[
AMapGeoPoint
locationWithLatitude
:[
latitude
floatValue
]
longitude
:[
longitude
floatValue
]];
request
.
page
=
1
;
request
.
offset
=
20
;
request
.
radius
=
1000
;
if
(
keywords
.
length
!=
0
)
{
request
.
keywords
=
keywords
;
}
if
(
city
.
length
!=
0
)
{
request
.
city
=
city
;
}
[
self
.
search
AMapPOIAroundSearch
:
request
];
}
#pragma mark -
#pragma mark -
#pragma mark - AMapSearchDelegate
#pragma mark - AMapSearchDelegate
...
...
lib/clx_map_poi_search.dart
浏览文件 @
4215f538
...
@@ -26,4 +26,9 @@ class ClxMapPoiSearch {
...
@@ -26,4 +26,9 @@ class ClxMapPoiSearch {
Future
<
PoiResult
?>
aroundSearch
(
double
latitude
,
double
longitude
)
{
Future
<
PoiResult
?>
aroundSearch
(
double
latitude
,
double
longitude
)
{
return
ClxMapPoiSearchPlatform
.
instance
.
aroundSearch
(
latitude
,
longitude
);
return
ClxMapPoiSearchPlatform
.
instance
.
aroundSearch
(
latitude
,
longitude
);
}
}
/// 周边搜索
Future
<
PoiResult
?>
aroundSearchAll
(
String
keywords
,
double
latitude
,
double
longitude
,
String
city
)
{
return
ClxMapPoiSearchPlatform
.
instance
.
aroundSearch
(
latitude
,
longitude
);
}
}
}
lib/core/clx_map_poi_search_method_channel.dart
浏览文件 @
4215f538
...
@@ -41,4 +41,15 @@ class MethodChannelClxMapPoiSearch extends ClxMapPoiSearchPlatform {
...
@@ -41,4 +41,15 @@ class MethodChannelClxMapPoiSearch extends ClxMapPoiSearchPlatform {
return
PoiResult
.
toPoiResult
(
searchPOIResult
);
return
PoiResult
.
toPoiResult
(
searchPOIResult
);
}
}
/// 周边搜索
Future
<
PoiResult
?>
aroundSearchAll
(
String
keywords
,
double
latitude
,
double
longitude
,
String
city
)
async
{
var
searchPOIResult
=
await
methodChannel
.
invokeMethod
<
dynamic
>(
'searchPOI#around#all'
,
<
String
,
dynamic
>{
'keywords'
:
keywords
,
'latitude'
:
latitude
,
'longitude'
:
longitude
,
'city'
:
city
,
});
return
PoiResult
.
toPoiResult
(
searchPOIResult
);
}
}
}
lib/core/clx_map_poi_search_platform_interface.dart
浏览文件 @
4215f538
...
@@ -47,4 +47,9 @@ abstract class ClxMapPoiSearchPlatform extends PlatformInterface {
...
@@ -47,4 +47,9 @@ abstract class ClxMapPoiSearchPlatform extends PlatformInterface {
Future
<
PoiResult
?>
aroundSearch
(
double
latitude
,
double
longitude
)
async
{
Future
<
PoiResult
?>
aroundSearch
(
double
latitude
,
double
longitude
)
async
{
throw
UnimplementedError
(
'aroundSearch() has not been implemented.'
);
throw
UnimplementedError
(
'aroundSearch() has not been implemented.'
);
}
}
/// 周边搜索
Future
<
PoiResult
?>
aroundSearchAll
(
String
keywords
,
double
latitude
,
double
longitude
,
String
city
)
async
{
throw
UnimplementedError
(
'aroundSearchAll() has not been implemented.'
);
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论