Skip to main content

@rnmapbox/maps

Mapbox maps for React Native

A community-supported, open-source library for building interactive maps with the native Mapbox Maps SDK on iOS and Android.

  • iOS
  • Android
  • Web (experimental)
  • Expo
  • New Architecture
npm install @rnmapbox/maps
The @rnmapbox/maps example app, built for the web. Open full screen

Maps as React components

Sources and layers are plain components: change props and the native map updates. The same code runs on iOS, Android and, experimentally, the web.

import Mapbox, {
MapView,
Camera,
ShapeSource,
CircleLayer,
} from '@rnmapbox/maps';

Mapbox.setAccessToken('<your public token>');

const QUAKES_URL = 'https://example.com/quakes.geojson';

export default function App() {
return (
<MapView style={{flex: 1}} styleURL={Mapbox.StyleURL.Dark}>
<Camera zoomLevel={5} centerCoordinate={[-121.5, 38]} />
<ShapeSource id="quakes" url={QUAKES_URL}>
<CircleLayer
id="quake-dots"
style={{circleRadius: 6, circleColor: '#fbb03b'}}
/>
</ShapeSource>
</MapView>
);
}
Three iPhone screenshots: a street map of New York, a topographic map of Yosemite Valley and a 3D terrain view

Turn-by-turn navigation

@rnmapbox/navigation (alpha) wraps the Mapbox Navigation SDK v3: request routes, run guidance and get route progress events, with the SDK drawing the route line, puck and navigation camera on your map. Or drop in a complete navigation screen with maneuver banners, lanes and speed limits.

<NavigationView> with a simulated route, on Android.

Built by the community

@rnmapbox/maps is open source and maintained by the community. Questions, bug reports and pull requests are welcome.