tld_amapsearch

Creator: coderz1093

Last updated:

0 purchases

tld_amapsearch Image
tld_amapsearch Images

Languages

Categories

Add to Cart

Description:

tld amapsearch

tld_amapsearch #
介绍
高德地图插件的封装,在官方基础上增加查询控件,可以dev搜索以下控件:
主要功能
1.增加地图查询功能,查询功能如下
​ (1)关键子检索 POI
​ (2)周边检索 POI
​ (3)天气检索
​ (4)地理编码(地址转坐标)
​ (5)逆地理编码(坐标转地址)
安装教程
tld_amap_search: ^last_version
copied to clipboard
使用说明


tld_amapsearch导包:
import 'package:tld_amapsearch/tld_amapSearch.dart';
copied to clipboard


在官方sdk上重新封装过,如需使用,可单独引入:
定位权限配置,使用第三方 permission_handler 动态权限工具, 使用方法请移步 permission_handler


使用


/// 初始化高德key
Future<void> initAmapKey() async {
bool result =
await TldAmapSearch.initKey(androidKey: '安卓key', iosKey: '苹果key');
print(result);
}
copied to clipboard
/// 设置隐私权限
void setPrivacy() async {
await TldAmapSearch.updatePrivacyShow(hasShow: true, hasContains: true);
await TldAmapSearch.updatePrivacyAgree(hasAgree: true);
}
copied to clipboard
/// 周边范围搜索
void searchAround() async {
await TldAmapSearch.searchAround(
longitude: 106.642904,
latitude: 26.653841,
back: (code, SearchResult data) {
print(data);
});
}
copied to clipboard
/// 关键字搜索
void searchkeyword() async {
await TldAmapSearch.searchKeyword(
keyWord: '万达广场',
back: (code, SearchResult data) {
print(data);
});
}
copied to clipboard
/// 天气查询
void searchWeather() async {
await TldAmapSearch.weatherSearch(
city: '北京市',
isLive: true,
liveBack: (code, LiveResult result) {
print(result);
},
foreBack: (code, ForeCastResult result) {
print(result);
});
}
copied to clipboard
// 地理编码
void geocode() async {
//地理编码
await TldAmapSearch.geocoding(address: "北京市", back: (code, data) {});
//逆地理编码
await TldAmapSearch.reGeocoding(
longitude: 106.642904, latitude: 26.653841, back: (code, data) {});
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.