-
Notifications
You must be signed in to change notification settings - Fork 1.3k
GPS marker on map #756
Comments
I changed the GPS button to toggle location updates on or off. The updates are once a second and keep the map centre updated. I used the https://github.com/mapzen/LOST that @bleege found. Now I need to figure out how to add a marker to the map with compass direction and accuracy circle. @incanus I guess this would be a good use of the client-side data stuff you are working on? |
Yes, this is exactly what that is for. You can maybe fake it at screen center for tracking for now (i.e. put the marker above the map) but that won't help when you want to pan the map while showing the user. |
Yeah I was thinking about faking it @incanus. To get around the scrolling issue I may calculate screen coord from the zoom level and lat/lon |
Yeah, for a single marker, I'll bet that will work fine for now. I'll be watching as that could be useful on iOS as a stopgap too. |
Will need to use these conversions: |
Related iOS ticket: #147 |
Related to annotations, I'm curious @ljbade @bleege @1ec5 @kkaefer to hear your thoughts on user tracking settings and how we might push some of that down to the GL core. For example, on iOS, with our SDK we took the model offered by MapKit, which is to have two separate API:
|
@incanus: how would we feed resources into GL? e.g. different resolution marker bitmaps with different scaling depending on dpi? Android does this for free with my current approach Is there different behaviour/visuals in respect to how Google vs Apple display GPS location? Also I would prefer to push the GPS coords from Java to native, and not callback from native to Java to fetch them. |
I don't mean to do the marker rendering in the core necessarily, but just the mode state tracking and calling back out to the platform edges for location API and client notifications. |
I have the initial version of the GPS marker (with compass support as backup) in https://github.com/mapbox/mapbox-gl-native/tree/android-conversions I think I will merge this, and continue more improvements in another branch. Future improvements:
|
Per chat, @1ec5 to look at the iOS side of this, porting functionality from the raster iOS SDK. |
As a first cut, we'll just do this platform-side. Later, we can push state down into the GL map layer. |
A good summary of what's involved is anything mentioning |
from mapbox/mapbox-ios-sdk Nothing shows up yet, and accuracy circle annotation and delegate methods are commented out. Ref #756.
@1ec5 so does iOS maps have the soft-lock thing where the map tracks the marker, until you touch it when it disables the lock? I see Google Maps tracks both rotation and pan locking. I think there needs to be a bit of a deadzone so an accidental touch doesn't unlock the marker. |
@ljbade, Apple Maps (and mapbox-ios-sdk) tracks the marker until you manually pan, zoom, or rotate. If you tap the compass (to face north), the map continues to track the user dot but no longer rotates with it. A fudge factor sounds like an interesting idea, probably out of scope for beta 1. And oh wow, I’m just noticing that we commandeered this Android ticket for iOS work. Oops. |
Hmm well once we are done with iOS, might as well just reassign to Android beta milestone rather than closing. |
iOS annotations API is in as of eded1d9. Not sure yet how to best reconcile this ticket's branch and that. |
Current work, which is fully reconciled with the iOS annotations API, is in the 756-user-dot branch, which depends on #1074. |
Now that we've got a PR for iOS, I'm removing this from the milestone and untagging iOS, but keeping the bug open to track the Android implementation. |
GPS Marker is now in the SDK as of #1940. It's missing the Accuracy Circle for now, but am holding off as we need the location tech first for testing as well as I want to look into redoing the User Location marker artwork to make it more Material Design friendly. |
@incanus i've implemented tracking as you describe, and with using the material design floating action button at the bottom right to toggle the modes, with material design icons from google (https://www.google.com/design/icons/). Would you be interested in me adding this to a branch? |
Glad to help! |
@bleege Can we add some sort of optional heading marker arrow to the location dot like you get in Google Maps? |
Also we should try to get some nice compass and location marker artwork that matches Material design. Accuracy circle is blue with white ring and drop shadow. it has a small translucent blue ring around it. There is also a separate arrow that can be optionally enabled and shows current compass or GPS heading. Finally there is a separate lighter translucent blue accuracy circle with a thin darker border. I think this can be drawn in the app so no need for a image here. The compass is smaller than what we use and partially translucent, and overall 'simpler'. When you tap on it and the map rotates to north you get a brief compass with a 'N`: This then fades out and disappears when map is fully north. List of images:
If we calculate the correct virtual size, then we can work out the dimensions needed for the images at each DPI level. @bleege Who is best to task with creating us these images? |
@ljbade New imagery for UserLocation has already been ticketed internally. :-) Heading / User Location Following first pass of implementation was graciously provided by @erf . It's on hold for the time being until we can make the processing more efficient. Please recall #2049. |
@bleege Ah I understand! I'm getting mixed up with these different location tickets. |
GPS Marker has been long implemented. Will implement Heading / User Location Following in |
I want to take whatever @bleege cooks up in https://github.com/mapbox/mapbox-android-sdk/issues/593 and https://github.com/mapbox/mapbox-android-sdk/issues/592 to implement a GPS map marker in the demo app.
The text was updated successfully, but these errors were encountered: