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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-maplibre-gl-js

v1.18.2

Published

MapLibre GL JS for React Native

Readme

[!IMPORTANT] This project is not affiliated with, endorsed by, or sponsored by MapLibre.

Table of contents

Supported platforms

| Platform | Status | |----------|--------| | iOS | ✅ | | Android | ✅ | | Web | ❌ |

Installation

npm install react-native-maplibre-gl-js

📚 Documentation

API Reference – Complete TypeScript API documentation.

For library developers – Internal architecture, glossary and design decisions.

🧪 Examples

Several real-world usage scenarios are available, you can explore them in two ways:

1. Map

2. Marker

3. Popup

4. GeoJSONSource

5. ImageSource

6. VideoSource

7. VectorTileSource

8. RasterTileSource

🏁 Getting started

The minimal setup to render a MapLibre map in React Native.

import { MapProvider, Map } from 'react-native-maplibre-gl-js';

const App = () => {
  return (
    <MapProvider>
      <Map
        options={{
          style: 'https://tiles.openfreemap.org/styles/liberty',
          center: [2.32, 48.86],
          zoom: 12,
        }}
      />
    </MapProvider>
  )
}

export default App

📝 Design rationale

Explain why I decided to build a new React Native map library instead of using an existing one.

Existing React Native map solutions

Considering tile-based maps, these are the maintained or supported libraries that can be used in React Native. Each has its strengths, and credit goes to their contributors. Still, I have highlighted what I consider to be their main drawbacks.

| Library | Notes | Main Drawbacks | |-----------------------------------|------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | react-native-maps / expo-maps | Overlay custom tiles on Apple Maps (iOS) or Google Maps (iOS/Android). | - On tile loading, the map below (Google Maps or Apple Maps) is visible.- If the map provider is Google Maps (mandatory on the Android platform), an API key is needed to use Google Maps SDK, and therefore its use is billed. | | @rnmapbox/maps | - | - Dependence on Mapbox choices.- On the latest versions, an API key is required (at least on the Android side that drops the MapLibre SDK support), and therefore its use is billed.- To render animated markers or markers with dynamic content and developed visual styles, the use of native views is necessary, and this greatly slows down the application. | | maplibre-react-native | Open source fork of MapBox. | - Being an open source fork of MapBox, the library is years behind (1000+ commits to date) and lacks many features and bug fixes.- The same performance issue with native views as @rnmapbox is also present. |

Architectural approach

To address these drawbacks, two main approaches are possible (as far as I know): either build a library on top of native views using free mobile SDKs (such as MapLibre Native, meaning the effort should instead go into improving maplibre-react-native), or leverage existing web-based map libraries.

The second option is far easier to build and maintain since it relies on a single rendering engine rather than separate iOS and Android SDKs. It also opens the door to fixing performance issues and limitations found in earlier libraries, while enabling more features.

I outline two solutions in this category below, along with the issues they still carry. This library implements the second approach.

| Approach | Description | Main Drawbacks | |----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Remote WebView-based map | Host a map on a web page and access it through a WebView. | - Requires additional infrastructure.- Very sensitive to network latency, and in general, a degraded user experience.- Offline usage is not possible. | | Embedded WebView with bundled MapLibre GL JS | Bundle JS code that runs MapLibre GL JS, enabling two-way communication with React Native, and inject it into a WebView for execution. | - Any interaction between the WebView content and the React Native world is made through message-passing, which can make certain interactions more indirect.- Some objects cannot be serialized and sent between the WebView code and React Native (e.g., HTMLElement).- Some GitHub repositories are implementing this solution, however, no one is actively maintained, and the underlying web libraries are missing key features — good examples being react-native-leaflet-view and @neukolabs/react-native-maplibre-js. |

Contributing

Credits

  • MapLibre for providing a free and open source alternative to MapBox.
  • OpenFreeMap for providing free tile data in the examples ❤️.

License

MIT