Open Hendini21 opened 4 years ago
Hey @Hendini21! What exactly are you stuck with? How far have you gotten with React Native and React Navigation? Are you able to move between screens?
I can move between screens, I just can't get the actual map to work. From there, the navigation algorithm is the easy part.
Hmm. What part of the map is not working? Are you using a library like react-native-maps? Can you upload your React Native project code to the repo?
Sure.
I was trying to use google maps as the base, but I can try react-native-maps
I have no idea what to do with react-native-maps. The program itself looks like it will work, but I have no idea how to implement it.
I haven't actually used the library before, but it looks like many have had success. Maybe take a look at these recent articles? https://www.instamobile.io/react-native-tutorials/react-native-maps/ https://blog.logrocket.com/introduction-to-react-native-maps/
I tried following the tutorial and it didn't work.
The first tutorial doesn't work... It doesn't seem to function at all.
What specifically are you having trouble with? What is not working and how far into the tutorial are you able to get? It will be easier to help if you can provide more details/code.
So I got a functional map, the tutorial was outdated, now I am just trying to figure out how to access the user's location so that the map can center on that and start there.
That code doesn't work... I have this https://snack.expo.io/@hendini/1d78dc but it doesn't work with the code they added, without it though, it works fine on android and ios.
at this link you can see the code that works. https://docs.expo.io/versions/v38.0.0/sdk/map-view/
Check this out. I tried to simplify the code from the tutorial to make it easier to understand. Added a "Get Location" button to get the current lat/long position and then animate the MapView to the region. It worked fine for me in the browser Android simulator and on a real iPhone with Expo. Hope this helps.
That is perfect! Thank you so much!
I am trying to understand how React Native works, but I can't figure it out. I am trying to use React Navigation, but I don't know how to get the entirety of the Snack before the navigation, because once I have the navigation, I can actually do stuff, because I am ready for that aspect.