Closed dzuluaga closed 1 year ago
I just checked the code. And the problem is that the variable omhLocation
from the class is not assigned.
It should be assigned like this(without val):
omhLocation = OmhMapProvider.getInstance().provideOmhLocation(this)
https://github.com/openmobilehub/omh-maps/assets/124717244/5972c808-5c5b-418f-9dac-69c4bffa7b9f
Thank you for spotting that and investigating. I believe we can prevent this situation from occurring. Considering that omhLocation
is only used in one specific location, declaring it as a member variable introduces the potential for errors, as it needs to be initialized in onCreate. To minimize the chances of mistakes, could you please utilize the function getCurrentLocation
as a variable instead? Here are some suggestions:
OmhMapProvider.getInstance().provideOmhLocation(this)?.getCurrentLocation(onSuccessListener, onFailureListener)
or if you need to assign omhLocation to a member variable:
OmhMapProvider.getInstance().provideOmhLocation(this)?.let { omhLocation ->
omhLocation.getCurrentLocation(onSuccessListener, onFailureListener)
}
Alright, changed.
Where? I still see omhLocation used in this fragment. https://github.com/openmobilehub/omh-maps/blob/release/1.0/maps-sample/src/main/java/com/omh/android/maps/sample/maps/MapFragment.kt#L187. In the future, please provide a link to the link to the commit with the changes. Thanks.
Sorry, probably the change was not merged yet.
LGTM. Thanks!
Description
The current implementation of our app fails to retrieve and display the user's current location. Despite calling the necessary functions, the app silently ignores them, resulting in the absence of the expected pin on the map. Furthermore, no error messages are logged, making it difficult to pinpoint the cause of this issue.
Steps to Reproduce
Expected Behavior
The app should properly call the required functions and display a pin indicating the user's current location on the map. We expect the Getting Started documentation to include steps to display the current location as part of the basic setup process.
Actual Behavior
The app neglects to execute the necessary functions, leading to the omission of the current location pin. No error messages or log entries provide clues regarding the cause of the problem.
Additional Information
Repository: Link to the GitHub repository
Impact
This issue is urgent as it confuses developers and obstructs progress in the app's development. Immediate attention and troubleshooting are required to resolve this bug.
Your prompt assistance in investigating and rectifying this issue would be highly appreciated. If any further details or clarifications are needed, please let us know.
Thank you for your attention to this matter.
CC - @rquino @prestonlau