Skip to content

Instantly share code, notes, and snippets.

@abegehr
Created February 13, 2020 12:49
Show Gist options
  • Save abegehr/1556254b199bdfb73ffaffee5c3d5dc8 to your computer and use it in GitHub Desktop.
Save abegehr/1556254b199bdfb73ffaffee5c3d5dc8 to your computer and use it in GitHub Desktop.
renders n random Markers
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