- I want to set a marker on MapView in React Native, but I can’t find any information through official documents of MapView.
- If it is not allowed in that way, how can I use existed react module such as react-googlemaps in React Native?
Advertisement
Answer
You can set markers using the annotations
prop.
For example:
JavaScript
x
14
14
1
var markers = [
2
{
3
latitude: 45.65,
4
longitude: -78.90,
5
title: 'Foo Place',
6
subtitle: '1234 Foo Drive'
7
}
8
];
9
10
<MapView
11
region={ }
12
annotations={markers}
13
/>
14