Created
July 16, 2020 04:31
-
-
Save miguelitodev/26ddd4f3c85c31d9041714a1d0751c45 to your computer and use it in GitHub Desktop.
Esse é o código que eu uso para mostrar o mapa e a localização atual via Marker no mapa. Nota: tem que usar region ali porque tendo em vista o código do outro arquivo a localização tende a mudar, e essa prop é preparada para isso
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
<MapView | |
style={styles.mapStyle} | |
region={{ | |
latitude: localizacao[0], | |
longitude: localizacao[1], | |
latitudeDelta: 0.0014, | |
longitudeDelta: 0.0014, | |
}} | |
> | |
<Marker | |
coordinate={{ | |
latitude: localizacao[0], | |
longitude: localizacao[1], | |
}} | |
title={"Titulo do seu marker"} | |
image={Aqui dentro você pode colocar a url da imagem do ícone} | |
/> | |
</MapView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment