Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@maplibre/maplibre-react-native
Advanced tools
A MapLibre GL Native plugin for creating maps in React Native
A React Native library for building maps with
the MapLibre GL Native SDK for iOS & Android.
This project originated as a fork of rnmapbox, a community-maintained React Native Library for building maps with the Mapbox iOS and Android mobile SDKs. The original product supported both Mapbox and MapLibre for some time, but as the MapLibre and Mapbox SDKs have diverged, it has become necessary to separate the projects into specific wrappers by underlying renderer.
This project is in the process of being onboarded and prepared for broad use by the MapLibre community. PRs and tickets welcomed. Track the status over at: https://github.com/maplibre/maplibre/issues/134
TODO: update NPM badge
# install with Yarn
yarn add @maplibre/maplibre-react-native
# or install with NPM
npm install @maplibre/maplibre-react-native --save
For more information, check out our Getting Started section
Before you run your project be sure you have completed the Installation Guides for Android or iOS.
# Run with yarn
yarn run ios
# or Run with NPM
npm run ios
# Run with yarn
yarn run android
# or Run with NPM
npm run android
import React, {Component} from 'react';
import {StyleSheet, View} from 'react-native';
import MapboxGL from '@maplibre/maplibre-react-native';
const styles = StyleSheet.create({
page: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
map: {
flex: 1,
alignSelf: 'stretch',
},
});
export default class App extends Component {
render() {
return (
<View style={styles.page}>
<MapboxGL.MapView
style={styles.map}
logoEnabled={false}
styleURL="https://demotiles.maplibre.org/style.json"
/>
</View>
);
}
}
This package is not available in the Expo Go app. Learn how you can use it with custom dev clients.
This project includes .nvmrc
. You should use nvm so that you're always developing for the correct
version of Node.
This project uses yarn
as a package manager. DO NOT install yarn
using npm
as that will install
the outdated 1.x branch. Full instructions are in the yarn docs,
but here's the quick checklist at the time of this writing.
corepack enable
corepack prepare yarn@stable --activate
pnp
; check your git working copy for changes and revert if necessary.yarn install
Your JetBrains IDE (such as IntelliJ) needs to be set to use yarn under Preferences > Languages & Frameworks > Node.js. This may require a manual change if you did not have yarn previously installed.
This library provides some mocks which are necessary for running tests.
Example:
"jest": {
"preset": "react-native",
"setupFilesAfterEnv": ["@maplibre/maplibre-react-native/setup-jest"]
}
When developing locally, it is often desirable to test in the context of an external project.
However, it's not easy to do this out of the box with yarn
or npm
.
yalc
can mitigate some of the pain with this.
Join the #maplibre-native Slack channel at OSMUS: get an invite at https://slack.openstreetmap.us/ Read the CONTRIBUTING.md guide in order to get familiar with how we do things around here.
FAQs
React Native library for creating maps with MapLibre Native for Android & iOS
The npm package @maplibre/maplibre-react-native receives a total of 1,943 weekly downloads. As such, @maplibre/maplibre-react-native popularity was classified as popular.
We found that @maplibre/maplibre-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.