-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Move Location API From TestApp To SDK #1940
Comments
Same as #1719 |
The Google Maps API has 2 key access points:
|
Ported Location tech and UserLocation API to GL SDK. Have also refactored the TestApp to run on it. Testing has revealed that the TestApp is using it correctly and that Location is being found. The only issue currently is that the UserLocation marker is not being displayed on the MapView. Next step is to debug that. |
Turns out the the UserLocation marker is not showing up because the MapView is a View class and can't be added directly. Experimented with having MapView extend |
@bleege Ah interesting. Hadn't thought of that being an issue but makes sense. Perhaps we need MapView to be a ViewGroup/FrameLayout with a inner GLSurfaceView constructed at run time we keep as a private member variable. Then just move some of the calls to set up GL to this variable. Going to need to something like this to be able to handle things like the Mapbox logo overlay. |
…ewGroup and having GL display on map as expected
I was able to get For a point of comparison, I looked at the Raster SDK's drawing of UserLocation. It avoids the Android View hierarchy all together and instead relies on direct painting using |
Refactoring to |
Just got UserLocation Dot! It just required refactoring the Next up is to move the Compass to the SDK and then everything should be SDK side, instead of app development side. |
Awesome work @bleege. What other UI widgets are missing from the map compared to iOS? Logo? Attribution? |
Initial port of Compass from TestApp to SDK is done. Now adding Google Maps API compatible on/off API. |
…ion_marker assets from App as they're now only in the SDK.
Added Google Maps API as well as a way to test it in the TestApp. All 👀 good. Punting on User Dot location accuracy for now, as they're likely be a new image UI / UX for it (ticket coming soon). We also need the Location API in the SDK sooner rather than later for testing. Merge is up next. |
Merged in #1999. |
Ugh... found a NullPointerException... java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ImageView.setVisibility(int)' on a null object reference
at com.mapbox.mapboxgl.views.MapView.updateMap(MapView.java:1657)
at com.mapbox.mapboxgl.views.MapView.access$800(MapView.java:65)
at com.mapbox.mapboxgl.views.MapView$1.onMapChanged(MapView.java:601)
at com.mapbox.mapboxgl.views.MapView$3.run(MapView.java:1410)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) |
Addressed in #2000. Will roll new SNAPSHOT now. |
…as Location provider
…Map API equivalents
…ing ViewGroup and having GL display on map as expected
… Location marker
…oggle and setup is done in correct order.
… of just a single instance
…moving debug log statements.
… location_marker assets from App as they're now only in the SDK.
The current Location API is custom built and layered on top of the SDK in the TestApp. Let's extract this into the SDK itself so that it can be used universally. Model the API after Google Maps.
Related to #756
The text was updated successfully, but these errors were encountered: