React Native Maps

1.27.2 · active · verified Sun Apr 19

React Native Maps is a comprehensive, community-maintained library providing native map components for both iOS and Android platforms, allowing developers to integrate highly customizable maps into their React Native applications. It supports popular map services like Apple Maps (MapKit) on iOS and Google Maps on Android, with an optional Google Maps provider for iOS as well. The current stable version is `1.27.2`, and the project demonstrates an active development cadence with multiple bug fix and minor releases occurring monthly or bi-monthly, reflecting continuous maintenance and improvement. Its key differentiator lies in its declarative, React-like API, enabling map features such as Markers, Polylines, Polygons, Circles, Overlays, and Heatmaps to be defined as children of the `<MapView />` component. This approach simplifies map state management and interaction. The library also emphasizes compatibility with both the "Old Architecture" and the newer "Fabric (New Architecture)" of React Native, though specific version requirements apply to each, which are crucial considerations for developers.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart renders a full-screen map centered on a specific region with a single interactive marker, demonstrating basic setup and controlled region state in a functional React Native component.

import React, { useState } from 'react';
import { StyleSheet, View } from 'react-native';
import MapView, { Marker, type Region } from 'react-native-maps';

export default function App() {
  const [region, setRegion] = useState<Region>({
    latitude: 37.78825,
    longitude: -122.4324,
    latitudeDelta: 0.0922,
    longitudeDelta: 0.0421,
  });

  const handleRegionChangeComplete = (newRegion: Region) => {
    setRegion(newRegion);
  };

  return (
    <View style={styles.container}>
      <MapView
        style={styles.map}
        region={region}
        onRegionChangeComplete={handleRegionChangeComplete}
      >
        <Marker
          coordinate={{ latitude: 37.78825, longitude: -122.4324 }}
          title="My Location"
          description="A sample marker on the map"
        />
      </MapView>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  map: {
    width: '100%',
    height: '100%',
  },
});

view raw JSON →