searchAround static method
周边搜索poi
在中心点center
周边搜索关键字keyword
和城市city
的poi, 可以设置每页数量pageSize和第page页
Implementation
static Future<List<AMapPoi>> searchAround(
Location center, {
String keyword = '',
String city = '',
int pageSize = 20,
int page = 1,
int radius = 1000,
}) async {
assert(page > 0 && page < 100, '页数范围为1-100');
assert(pageSize > 0 && pageSize < 50, '每页大小范围为1-50');
final List? dataList = await _channel.invokeMethod('searchAround', {
'keyword': keyword,
'city': city,
'pageSize': pageSize,
'page': page,
'longitude': center.longitude,
'latitude': center.latitude
});
return dataList?.map((e) {
return AMapPoi.fromJson(e);
}).toList() ??
[];
}