npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-amap-gd

v1.0.1

Published

Cordova Amap Navigator Plugin

Downloads

2

Readme

cordova-plugin-amap-gd

高德导航和定位的cordova插件

  • android依赖版本:6.9.1

  • io依赖版本:

高德定位

  • android版本: 4.7.0

Install

cordova plugin add cordova-plugin-amap-gd --variable ANDROID_KEY=key --variable IOS_KEY=key

iOS安装后build报错

如果只iOS上build报错,请按这里的方法处理

Useage

参选详情请参见https://lbs.amap.com/api/android-navi-sdk/guide/navi-component/use-navi-component

android缺少权限

请配合这个插件获取权限https://www.npmjs.com/package/cordova-plugin-android-permissions

普通导航

  • 参数中的点为可选参数
window.amap.startNavi({
    start: { 
            name: "北京站", lat: 39.904556, lng: 116.427231,poiid:"B000A83M61"
         },
    wayList:[
        { 
            name: "北京站", lat: 39.904556, lng: 116.427231 
        },{ 
            name: "北京站", lat: 39.904556, lng: 116.427231 
        }
    ]
    , end: { 
            name: "北京站", lat: 39.904556, lng: 116.427231 
        }
    } );

货车导航

  • 参数中的点为可选参数
window.amap.startNavi({
    start: { 
            name: "北京站", lat: 39.904556, lng: 116.427231,poiid:"B000A83M61"
         },
    wayList:[
        { 
            name: "北京站", lat: 39.904556, lng: 116.427231 
        },{ 
            name: "北京站", lat: 39.904556, lng: 116.427231 
        }
    ]
    , end: { 
            name: "北京站", lat: 39.904556, lng: 116.427231 
        }
    ,carInfo:{
        carType:1,carNumber:"渝B88888",size:4,load:50,weight:20,
        length:25,width:2,height:4,axis:6,loadSwitch:true,restriction:true
    }
    } );

定位一次

 window.amap.getLocation(options,location => {},location => {}
                    );

连续定位

//连续定位在启动后,位置信息需要在下面的定位事件回调里面获取
window.amap.startLocation(options);

定位参数options说明

|名称|说明|支持平台 |--|--|--| |purpose|设置定位场景,目前支持三种场景(0=签到、1=出行、2=运动,默认无场景)|Android| |mode|定位模式:0=低功耗模式,1=设备定位模式,2=高精度模式|其中iOS支持2和0类型| |interval|连续定位时,定位的间隔|Android| |address|是否需要返回地址信息|Android,iOS| |mock|是否允许模拟软件Mock位置结果|Android| |timeout|定位的超时,默认30s(单位:毫秒)|Android| |cache|是否开启定位缓存机制|Android|

定位返回的结果location说明

|字段|说明|是否不支持iOS| |--|--|--| |lat|纬度| |lng|经度| |acc|定位精度 单位:米|是| |alt|海拔高度信息|是| |spe|速度,单位:米/秒|是| |bea|方向角信息|是| |bui|室内定位建筑物Id|是| |flo|室内定位楼层|是| |add|地址描述| |cou|国家名称| |pro|省名称| |cit|城市名称| |dis|城区名称| |str|街道名称| |strNum|街道门牌号信息| |citCode|城市编码信息| |adc|区域编码信息| |poi|当前位置的POI名称| |aoi|当前位置所处AOI名称| |gps|获取GPS当前状态,返回值可参考AMapLocation类提供的常量|是| |loc|定位结果来源|是| |locD|信息描述|是| |einfo|错误信息描述| |ecode|错误码|

导航事件

监听事件

window.addEventListener('amapnavi',function(params){console.log(params.eventType);console.log(params.data)},false);

|事件eventType|说明|返回数据data| |--|--|--| |initNaviFailure|导航初始化失败|| |navigationText|导航语音的文本|字符串| |locationChange|经纬度变化的回调|{lat:,lng:,}| |startNavi|开始导航|数字| |exitPage|退出导航|数字|

连续定位事件

window.addEventListener('amaplocation',function(l){ console.log(l)},false);