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

react-native-wmm-tencentmap

v0.13.0

Published

腾讯地图选点及定位

Downloads

38

Readme

react-native-wmm-tencentmap

腾讯地图选点及定位

Installation

npm install react-native-wmm-tencentmap

Usage

import * as WMMTencentMap from "react-native-wmm-tencentmap";

// ...

// 初始化之前必须先设置隐私合规同意授权WMMTencentMap.setUserAgreePrivacy(true)。app隐私协议必须包含腾讯地图相关隐私协议.未授权会返回RESULT_CODES.PRIVACY_DENY
WMMTencentMap.setUserAgreePrivacy(true)

// 初始化 传入申请好的key值(android需单独配置,参考下面android配置)
WMMTencentMap.init("your_tencentMapSdk_key")

/**
 * 地图选点
 * @param option 反显数据载体,将选点接收到的数据原封传回  {id:"111",title:"xxx",address:"xxx",selectLatLng:{latitudeStr:"30.997859",longitudeStr: "121.004361",xxx:'xxx'}....}
 */
const option = {
  title: '上海市陶行知纪念馆',
  address: '上海市宝山区武威东路76号',
  selectLatLng: {
    latitudeStr: '31.276573',
    longitudeStr: '121.409535'
  },
  xxx1:"xxx1",
  xxx2:"xxx2........",
}
WMMTencentMap.selectAddress(option)

// 定位
WMMTencentMap.location()

// 跳转到权限设置
WMMTencentMap.goToAppDetail()

// 注册监听
WMMTencentMap.addListener(WMMTencentMap.EVENTS.onLocationSuccess,(res)=>{
    if (res){
        // res.code
        // res.result
        // res.message
    }
})
WMMTencentMap.addListener(WMMTencentMap.EVENTS.onLocationFailed,(res)=>{
  if (res){
    // res.code
    // res.result
    // res.message
  }
})

/**
 * RESULT_CODES
 */
export const RESULT_CODES = {
  PERMISSIONS_DENY: 600001, // 用户拒绝授权,需要提示跳转到系统设置页
  PRIVACY_DENY: 600002, // 隐私合规未同意授权
  SELECT_ADDRESS_SUCCESS: 600003, // 地图选择成功
  SELECT_ADDRESS_USER_CANCEL: 600004, // 地图选择用户取消
  LOCATION_SUCCESS: 600005, // 定位成功
  LOCATION_FAIL: 600006, // 定位失败
};

/**
 * 支持的监听事件
 */
export const EVENTS = {
  onLocationSuccess: 'onLocationSuccess',
  onLocationFailed: 'onLocationFailed',
  onSelectAddressSuccess: 'onSelectAddressSuccess',
  onSelectAddressFailed: 'onSelectAddressFailed',
};


Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library