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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mall-to/location-sdk

v1.6.5

Published

墨兔室内定位

Readme

MallTo Location SDK

墨兔室内定位SDK

快速上手

引入依赖库

yarn add @mall-to/location-sdk // 或 npm i @mall-to/location-sdk

初始化

需要在项目入口或者对应的页面引用,并且初始化sdk

import MallToLocation from '@mall-to/location-sdk'
const mallToLocation = new MallToLocation({
    appId: '999',
    appSecret: 'testsecret',
    uuid: '1008'
})

开启定位

    mallToLocation.onPosition({
        // ⚠️ 这里可以用openid、user_id、mac、等有效唯一标识
        openid: 1 //or mac:xxxxx
    }, {
        openInertialNavigation: false, // 开启惯性导航 默认关闭,关闭时每秒返回一次定位结果,开启后100ms返回一次定位结果
    }, res => {
        console.log(res)
        if (res.success) {
            console.log('位置信息: \t', res.data.position)
        } else {
            console.log('位置信息获取失败: \t', res.data.msg)
        }
    })

更好的渲染点位到地图上

因为两次定位结果返回有时间间隔,所以可以在渲染点位的时候加入位移动画,从而有更好的显示效果. 详见点位更新平滑移动方案

停止定位

    mallToLocation.stopPosition()

示例代码

详见

详细定位API

定位监听

mallToLocation.onPosition(
    {
        // ⚠️ 这里可以用openid、user_id、mac、等有效唯一标识
        openid: 1 //or mac:xxxxx
        // userId: '1',
        // macId: '1',
        // [key: string]: string 传入一种唯一标识即可
    },
    {
        delay: 0, // 延迟n秒后开始获取位置, 默认0
        interval: 1000, // 每隔n秒获取一次位置, 默认1000
        delayStopTime: 10 * 1000, // 位置停止移动延迟停止位置更新时间 默认10秒
        stopWalkingRefreshRange: 2, // 人物停止移动后位置更新的边界 默认2米
        openInertialNavigation: false // 开启惯性导航 默认关闭,关闭时每秒返回一次定位结果,开启后100ms返回一次定位结果
    },
    res => {
      console.log(res)
      if (res.success) {
          console.log('位置信息: \t', res.data.position)
      } else {
          console.log('位置信息获取失败: \t', res.data.msg)
      }
    }
)

停止定位

mallToLocation.stopPosition()

更多API文档