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

@cniot/react-native-map-linking

v1.0.9

Published

Use a third-party map plugin for navigation, compatible android and ios. add navigate method

Downloads

5

Readme

English | 简体中文

react-native-map-linking

Go to third-party Map App for navigation, Android mobile stand by Gaode Map and BaiDu Map and Tencent Map, IOS mobile stand by Gaode Map and BaiDu Map and Tencent Map and Apple Map.

npm version

Example:Call the API to pass the starting location info and end location info to jump to the specified map app for navigation.

  • Prompt recommended download list when no third-party map app is installed (IOS comes with Apple map)
  • Select one of them to jump to the download address page (👇the following are the pages of Gao De Map, Baidu Map, Tencent Map)
  • When the system has a third-party map application installed, only the list of existing app is displayed.
  • Click on the list item and jump to the corresponding map application to navigate (the following are the navigation pages of Gao De Map, Baidu Map, Tencent Map)

Install

yarn

yarn add @iwubida/react-native-map-linking

npm install

npm install @iwubida/react-native-map-linking

Usage

import MapLinking from '@iwubida/react-native-map-linking';
import React, { PureComponent } from 'react';
import { TouchableOpacity, Text } from 'react-native';

class Demo extends PureComponent {
  handleChange = () => {
    // starting location info
    const startLocation = {
      lng: 106.534892,
      lat: 29.551891,
      title: '李子坝抗战遗址公园'
    };

    // end location info
    const destLocation = {
      lng: 106.27613,
      lat: 29.972084,
      title: '合川区邮政局(重庆市南园路198号)'
    };

    MapLinking.planRoute({ startLocation, destLocation });
  };

  render() {
    return (
      <TouchableOpacity onPress={this.handleChange}>
        <Text>start navigation</Text>
      </TouchableOpacity>
    );
  }
}

export default Demo;

If you need to be compatible with Tencent map, you need to initialize the incoming Tencent map developer key. Application URL

import MapLinking from '@iwubida/react-native-map-linking';

componentDidMount() {
  MapLinking.init({ tmapKey: 'OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77' });
}

Parameter support description

planRoute API is supports following properties

import MapLinking from '@iwubida/react-native-map-linking';

// 路径规划
MapLinking.planRoute({ startLocation, destLocation, mode, type });

// 从当前位置导航
MapLinking.navigate(destLocation);

| Name | Type | Default | Description | | :-: | :-: | :-: | :-: | | startLocation | object | null | Starting location info | | destLocation | object | null | End location info | | mode | string | 'ride' | Navigation mode ['drive','bus','ride', 'walk'] | | type | string | 'gcj02' | coordinate type ['gcj02', 'wgs84'] |

startLocation and destLocation is supports following properties

| Name | Type | Description | | :-: | :-: | :-: | | lng | number | longitude | | lat | object | latitude | | title | string | address |