New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigating up from filter display repositions the camera #297
Comments
Definitely a bug in my opinion. Shouldn't be too hard to fix I think - worst comes to worst, we can record in a member variable of the |
The solution is to override
in In this solution, in order for
If References: |
Rollbar registered the following error: ``` java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.moveCamera( com.google.android.gms.maps.CameraUpdate)' on a null object reference at org.azavea.otm.ui.MainMapFragment.lambda$null$3 (MainMapFragment.java:488) ``` It's probably a race condition. Tame the asynchronous control flow to eliminate race conditions. AFAIK, this fixes all race conditions except open question OpenTreeMap#1 below. Unknown how many rollbar errors it will eliminate, but should eliminate the original npe. Refer to * [MapView](https://developers.google.com/android/reference/com/google/android/gms/maps/MapView) * [GoogleMap](https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap) * [MapsInitializer](https://developers.google.com/android/reference/com/google/android/gms/maps/MapsInitializer) * [GoogleApiAvailability](https://developers.google.com/android/reference/com/google/android/gms/common/GoogleApiAvailability) * [Fragment Life Cycle](https://developer.android.com/guide/components/fragments.html) Changes: - Use jDeferred to synchronize between asynchronous flows - Move most initialization from onCreateView to `onActivityCreated` - Move google api connect, map fetch, and add mode cancel to `onStart` - Update `MapHelper` to use current google availability api Open questions: 1. Need a way to manage the `MapHelper` google api dialog to determine whether the play store services problem gets resolved, and fail catastrophically if it doesn't. 2. Need a way to test missing play store services without wrecking my phone. 3. Fails to fix OpenTreeMap#297, clearing the filter repositions the camera 4. Probably shouldn't create new `Deferred` objects if they already exist, but haven't noticed any negative effects of doing so 5. I don't know enough about the tile cache to be sure when it needs to be cleared. -- Connects to OpenTreeMap#294
As we discussed in person, this can be fixed rather easily by overriding the up-navigation handling in |
@maurizi, |
Related to #301 (after switching tree maps, using the back button ... previous tree map). The |
@dboyer, need your input on whether this is desirable behavior, but I find it unexpected and jarring, and thought I had introduced a bug until I discovered it happening in the released android app.
Visit a treemap that includes your current location. The camera pans & zooms to your current location, which is good.
Pan and zoom away from the current location.
Tap the filter button, then tap the OTM logo, AKA the Navigate Up button.
It pans/zooms to your current location again. Seems like it ought to just return to where you were on the map.
The same problem exists when navigating up from tree details.
If you have location turned off, it pans/zooms to the default location and z, even more disconcerting.
The text was updated successfully, but these errors were encountered: