6.0.5 • Published 8 months ago

capacitor-plugin-amap v6.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

capacitor-plugin-amap

Amap Capacitor

大版本跟@capacitor

v6.x support Capacitor 6

Install

npm install capacitor-plugin-amap
npx cap sync

IOS

配置IOS_KEY IOS安装插件后,需在项目的capacitor.config.ts/capacitor.config.json中为项目配置IOS_KEY

const config: CapacitorConfig = {
    plugins: {
        AMap: {
            iosKey: "your key",
        },
    }
};

IOS安装插件后,需在XCODE的info.plist中为项目配置以下内容

    <key>NSLocationWhenInUseUsageDescription</key>
    <string>此应用需要定位权限才能正常使用</string>

Android

add the following to your app's build.gradle:

// 这里sdk获取方式不能用这种填充,可以忽略这步,内部实现会自动处理appkey
manifestPlaceholders = [
  AMAP_APPKEY: "map key",
]

API

init()

init() => void

locate()

locate() => any

Returns: any


weather(...)

weather(param: { adCode: string; }) => any
ParamType
param{ adCode: string; }

Returns: any


calculate(...)

calculate(params: { startLatitude: number; startLongitude: number; endLatitude: number; endLongitude: number; }) => any
ParamType
params{ startLatitude: number; startLongitude: number; endLatitude: number; endLongitude: number; }

Returns: any


Interfaces

Location

PropTypeDescription
accuracynumber定位精度
adCodestring区域编码
addressstring地址
citystring城市|
cityCodestring城市编码
latitudenumber精度
longitudenumber纬度
aoiNamestring当前定位点的AOI信息
countrystring国家
districtstring城区信息
poiNamestring当前定位点的POI信息
provincestring省份
streetstring街道
streetNumstring街道号
locationTimeDate定位时间

WeatherInfo

PropTypeDescription
type'live' | 'forecast'
weatherstring天气
temperaturestring温度
citystring城市|
provincestring省份
windDirectionstring风向
windPowerstring风力
humiditystring湿度
6.0.5

8 months ago

6.0.4

8 months ago

6.0.2

8 months ago

6.0.1

8 months ago

6.0.0

8 months ago

0.0.1

2 years ago