You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@splicer97/react-native-osmdroid

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@splicer97/react-native-osmdroid

This is unofficial React Native wrapper for osmdroid maps

0.14.1
latest
Source
npm
Version published
Weekly downloads
23
-61.02%
Maintainers
0
Weekly downloads
 
Created
Source

react-native-osmdroid npm version Downloads

React Native Open Street Maps components for Android. This is unofficial React Native wrapper for Osmdroid SDK. Many thanks to fqborges for his library, which is the basis of this library!

Installation

npm install @splicer97/react-native-osmdroid

or

yarn add @splicer97/react-native-osmdroid

Manifest

In most cases, you will have to set the following authorizations in your AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"  />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

If you are only using parts of the library, you can adjust the permissions accordingly.

Online tile provider

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"  />

Offline tile provider and storing tiles

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Location provider

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

Android 6.0+ devices require you have to check for "dangerous" permissions at runtime. osmdroid requires the following dangerous permissions: WRITE_EXTERNAL_STORAGE and ACCESS_COARSE_LOCATION/ACCESS_FINE_LOCATION. See OpenStreetMapViewer's implementation or Google Documentation on Permissions

Component API

<MapView /> Component API

<Marker /> Component API

<Callout /> Component API

<Polygon /> Component API

<Polyline /> Component API

<Circle /> Component API

<Overlay /> Component API

<Heatmap /> Component API

<Geojson /> Component API

<URLTile /> and <WMSTile /> Component API

Usage

import MapView from '@splicer97/react-native-osmdroid';

// ...
<MapView
  initialRegion={{
    latitude: 37.78825,
    longitude: -122.4324,
    latitudeDelta: 0.0922,
    longitudeDelta: 0.0421,
  }}
/>;

Examples

MapView

mapView

Polyline

polyline

Marker

marker

Polygon

polygon

Circle

circle

UrlTile

urlTile

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

Keywords

react-native

FAQs

Package last updated on 03 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts