# longdo-map-react-native

> Longdo Map component for React Native

Latest version **3.0.7** (published 2022-11-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install longdo-map-react-native
pnpm add longdo-map-react-native
yarn add longdo-map-react-native
bun add longdo-map-react-native
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.7 |
| Published | 2022-11-29 |
| First published | 2021-06-22 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | TK |
| Maintainers | mmtech |
| Keywords | longdo, map, react-native |

## Links

- npm: https://www.npmjs.com/package/longdo-map-react-native
- Repository: https://github.com/MetamediaTechnology/longdo-map-react-native
- Homepage: https://github.com/MetamediaTechnology/longdo-map-react-native#readme
- Issues: https://github.com/MetamediaTechnology/longdo-map-react-native/issues
- npm.io page: https://npm.io/package/longdo-map-react-native

## Recent versions

- 3.0.7 (latest) — 2022-11-29
- 3.0.6 — 2022-11-25
- 3.0.5 — 2022-10-03
- 3.0.4 — 2022-09-22
- 3.0.3 — 2022-09-08
- 3.0.2 — 2022-06-13
- 3.0.1 — 2022-03-31
- 3.0.0 — 2021-12-07
- 1.0.3 — 2021-06-28
- 1.0.2 — 2021-06-25
- 1.0.1 — 2021-06-22
- 1.0.0 — 2021-06-22

## README

# Longdo Map Component for React Native 
![npm](https://img.shields.io/npm/v/longdo-map-react-native)
![npm](https://img.shields.io/npm/dt/longdo-map-react-native)
![npm](https://img.shields.io/npm/l/longdo-map-react-native)
- [Setting Up (Expo)](#setting-up-expo)
- [Setting Up (Native)](#setting-up-native)
- [Getting Started](#getting-started)
- [Documentation](#documentation)
- [Version](#version)
## 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](https://reactnative.dev/docs/environment-setup) 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](example/App.js)
### Run in Simulator  
```
npm run ios
npm run android
```
Follow this [instruction](https://medium.com/@davidjasonharding/developing-a-react-native-app-on-an-m1-mac-without-rosetta-29fcc7314d70) to run on Mac M1
## Documentation
- [Reference 3.x](https://github.com/MetamediaTechnology/longdo-map-react-native/wiki/)
- [Reference 1.x](https://api.longdo.com/map/doc/react-native.php)
- [JavaScript documentation](https://map.longdo.com/docs/)
## Version
- 3.x: Vector map GL backend
- 1.x: Raster map backend

---
_Source: https://npm.io/package/longdo-map-react-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
