Annotating points of interest
Annotations are exactly what they sound like: additional information rendered on top of the basic map geography. You get annotations by default when you render MapView
components. The MapView
component can render the user’s current location and points of interest around the user. The challenge here is that you probably want to show the points of interest relevant to your application instead of those rendered by default.
In this section, you’ll learn how to render markers for specific locations on the map, as well as rendering regions on the map.
Plotting points
Let’s plot some local breweries! Here’s how you pass annotations to the MapView
component:
<MapView
style={styles.mapView}
showsPointsOfInterest={false}
showsUserLocation
followsUserLocation
>
<Marker
title="Duff Brewery"
description="Duff beer for me, Duff beer for you"
coordinate={{
latitude:...