MapView and Marker

MapView is the React Native Maps component that renders a geographic map, while Marker displays a visual object at a specified latitude and longitude. In this course, the customer application uses a marker to represent the rider's latest known position and animates its movement as new coordinates arrive.

Minimal example

tsx
import MapView, { Marker } from "react-native-maps";

<MapView style={{ flex: 1 }} initialRegion={region}>
  <Marker
    coordinate={riderCoordinate}
    tracksViewChanges={false}
  />
</MapView>

Learn this concept

Lesson 5.9 · Watching foreground location

Used in exercises

Exercise 5.12 · Rider mode and customer tracking screens Exercise 5.17 · Rider map geometry library
Prerequisite conceptsExpo Go