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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-baidu-map-x

v2.0.10

Published

a native dialog module

Downloads

129

Readme

react-native-baidu-map-x

  • 目前仅支持android
  • baidu-map-sdk:4.5.2

导入

  • 配置settings.gradle
include ':react-native-baidu-map-x'
project(':react-native-baidu-map-x').projectDir = new File(settingsDir, '../node_modules/react-native-baidu-map-x/android')
  • 配置build.gradle(app)
compile project(':react-native-baidu-map-x')
  • 配置MainApplication.java
    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
            ...
              //add BaiduMapPackage
              new BaiduMapPackage(getApplicationContext())
            ...
      );
    }
  • 配置AndroidMainifest.xml -权限
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    //读取设备硬件信息,统计数据
    <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
    //读取系统信息,包含系统版本等信息,用作统计
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    //获取设备的网络状态,鉴权所需网络代理
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    //允许sd卡写权限,需写入地图数据,禁用后无法显示地图
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    //获取统计数据
    <uses-permission android:name="android.permission.GET_TASKS" />
    //鉴权所需该权限获取进程列表
    <uses-permission android:name="android.permission.CAMERA" />
    <!-- 这个权限用于进行网络定位-->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <!-- 这个权限用于访问GPS定位-->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <!-- 获取运营商信息,用于支持提供运营商信息相关的接口-->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位-->
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

    <!-- 访问网络,网络定位需要上网-->
    <uses-permission android:name="android.permission.INTERNET" />
    <!-- SD卡读取权限,用户写入离线定位数据-->
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
  • 配置AndroidMainifest.xml -百度地图key(不添加无法显示地图)
<meta-data android:name="com.baidu.lbsapi.API_KEY" android:value="百度API KEY"/>
  • 配置AndroidMainifest.xml -服务(调用导航和定位用)
<service android:name="com.baidu.location.f" android:enabled="true" android:process=":remote"> </service>

使用

import { MapView,ColorTypes,MapTypes, MapModule, Geolocation,Navi,Location } from 'react-native-baidu-map-x'

MapView Props 属性

| Name | Type | Default | Extra | ----------------------- |:-----:| :-------:| ------- | zoomControlsVisible | bool | false | Android only | trafficEnabled | bool | false | | baiduHeatMapEnabled | bool | false | | mapType | number| 1 | | zoom | number| 10 | | center | object| null | {latitude: 0, longitude: 0} | markers | array | [] | [marker, maker] | lines | array | [] | | circles |array|[]| | onMapStatusChangeStart | func | undefined| Android only | onMapStatusChange | func | undefined| | onMapStatusChangeFinish | func | undefined| Android only | onMapLoaded | func | undefined| | onMapClick | func | undefined| | onMapDoubleClick | func | undefined| | onMarkerClick | func | undefined| | onMarkerClick | func | undefined| | onLineClick | func | undefined|

Navi导航 Props 属性

| Name | Type | Default | Extra | ----------------------- |:-----:| :-------:| ------- | openBaiduMapNavi | func | undefined|

Location定位 Props 属性

| Name | Type | Default | Extra | ----------------------- |:-----:| :-------:| ------- | getLocation | promise | undefined|