I cant seem to set the latitude and longitude from toDoData1 and toDoData2. I get the error of Value for latitude cannot be cast from ReadableNativeArray to Double
Can anyone suggest a idea on how do I solve the following? I am able to extract the latitude and longitude from my firebase realtime db but I cant put it for the map region’s latitude and longitude via toDoData1 and toDoData2.
I get the same error (Screenshot of the app) in my previous comment.
I dont know if this will help or not but my intention on this page is to put 2 markers. 1 marker is for the current location (MapRegionNow) of the user using the app and the 2nd marker is for the destination (MapRegion). This destination, latitude and longitude values are extracted from firebase realtime database.
Oh! Finally it work. Thanks for the explanation and thank you very much ! I understand now but mind if I ask a few question regarding this mapview? I am new at this and I am still trying to learn.
Currently my code
The MapRegionNow is for my current location. How do I make this marker for MapRegionNow appear after I click the button of Get Location . Because now it just appears in my screen without me clicking the button
Is it possible to create a path between the 2 markers?
(You could check both lat and long, but one is enough.)
You are calling userLocation() in the useEffect hook, so it will automatically do that without the user pressing the button:
If you remove that userLocation() call then it won’t run until the user presses the button.
Sorry, I don’t know. Actually all of your questions in this thread are unrelated to Expo so this is not the best place to ask them. You should ask questions like this in a community dedicated to React Native Maps if there is one, or else a place like Stack Overflow.
I actually tried to did the similar trick that you have suggested in the earlier problem but it just pop up with all sorts of new error that I never see before which is why I pop the question on this issue.
Regarding the 2nd issue, it’s okay ! Thanks for willing to help me on this, giving me a clear explanation for the issues that I am asking. Really, thanks a lot ! I’m very grateful for that. This is because I am a beginner in developing a app using expo, actually my first time and the documents can be overwhelming for me which is why I don’t understand some stuff despite referring to documents/youtube guides/forums.
Regarding about posting question like this, I thought this Expo Location is under Expo SDK according to API Reference - Expo Documentation at the left hand side under Expo SDK so I thought it should be okay to post under Expo SDK. I actually did tried posting on Stack Overflow about 12 hours ago to look for a way to solve the issues but no one reply. So I tried posting the issue here hoping someone can guide me into fixing the issue I am. So thank you very much !
Yes, I understand It takes a while to figure things out.
Oh, and feel free to post your working code as an answer under your Stack Overflow question.
It’s not disallowed, but the purpose of these forums is to discuss things specific to Expo. If something is not specific to Expo then it’s best to discuss them elsewhere.