Created
February 13, 2020 12:49
-
-
Save abegehr/1556254b199bdfb73ffaffee5c3d5dc8 to your computer and use it in GitHub Desktop.
renders n random Markers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function renderRandomMarkers(n) { | |
const { latitude, longitude, latitudeDelta, longitudeDelta } = initialRegion; | |
return new Array(n).fill().map((x, i) => ( | |
<Marker | |
key={i} | |
coordinate={{ | |
latitude: latitude + (Math.random() - 0.5) * latitudeDelta, | |
longitude: longitude + (Math.random() - 0.5) * longitudeDelta | |
}} | |
/> | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment