3.0.7 • Published 2 years ago

longdo-map-react-native v3.0.7

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Longdo Map Component for React Native

npm npm npm

Setting Up (Expo)

Install & init project

npm install -g expo-cli
expo init <project name>
cd <project name>
expo install react-native-webview
npm install longdo-map-react-native

Config babel.config.js

    presets: [
      'babel-preset-expo',
      ['@babel/preset-env', { "targets": "iOS >= 11, Android >= 56" }],
    ],

Config app.json

    "ios": {
      "bundleIdentifier": "BUNDLE_ID",
...
    "android": {
      "package": "PACKAGE_NAME",

Then, Register BUNDLE_ID, PACKAGE_NAME at https://map.longdo.com/api to obtain API_KEY

Setting Up (Native)

Follow React Native CLI Quickstart instruction and run

npm install react-native-webview longdo-map-react-native
npm install -D @babel/preset-env

Config babel.config.js

  presets: [
    'module:metro-react-native-babel-preset',
    ['@babel/preset-env', { "targets": "iOS >= 11, Android >= 56" }],
  ],

From app.json

  "name": PROJECT_NAME,

Register PROJECT_NAME at https://map.longdo.com/api to obtain API_KEY

Getting Started

Add MapView in App.js

import Longdo from 'longdo-map-react-native';

In main App function

Longdo.apiKey = 'API_KEY';

If module fail to auto-detect app's bundle ID, add Longdo.bundleId = 'REGISTERED_ID';

Under root View

<Longdo.MapView />

In StyleSheet

alignItems: 'stretch'

For complete file, see example/App.js

Run in Simulator

npm run ios
npm run android

Follow this instruction to run on Mac M1

Documentation

Version

  • 3.x: Vector map GL backend
  • 1.x: Raster map backend
3.0.7

2 years ago

3.0.6

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.5

2 years ago

3.0.2

2 years ago

3.0.1

3 years ago

3.0.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago