You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Popups, callouts, bubbles, whatever you want to call them, we need selection state and info bubbles on markers.
Per @jfirebaugh (and I agree) we should do these for each platform because they are distinct and need to feel natural to the platform, such as being complex, even animated, views and being able to contain other platform-specific views.
For this reason, I think we should only worry about this on Android and iOS.
I've been very happy with SMCalloutView, which we integrated into our iOS SDK, and I think we should continue to use that here.
Also of note is that the performance implications of not doing this in GL core itself will be small. At least on iOS, only one callout is present at a time (single selection) and just simply tracks on the map.
@1ec5 has been starting to look into this, tracking using CADisplayLink but going to try @bleege's work on a "region is actively changing" delegate method in iOS.
Annotation selection should work something like this. Note that unlike MapKit, the z-index of the selected marker doesn't change (that's in #991).
This is done with something like d53fb94, which just does a dumb 44px box around the touch for point-in-bounds querying, then iterates selection state through the close-by annotations. It doesn't take marker icon size into account; likely we'll want to make this box a bit larger and emphasize in the top direction.
This is kind of like JS's featuresAt(), since point annotations' tiles work like an R-Tree.
Summarizing state of popups. The tough nut to crack here is syncing pan and zoom — including decelerated coasting — between native iOS views and the GL view. We've tried this in three branches, with varying combos of MGLAnnotation protocol data objects or other placeholder markers.
877-display-link — using CADisplayLink callback to sync simple UIImageView markers with GL
877-callout — bringing in SMCalloutView popups & updating position of it and UIImageView markers using a new mbgl::MapChangeRegionIsChanging event coming out of GL
877-point-callout — same as above, but originally merging in GL-side point annotation work (@1ec5 I think we can fold this into the above branch now?)
The next approach I'm going to try is, since we're tracking annotations' positions GL-side, have GL update their screen position values every frame draw, and have Cocoa read out those values, translate to CGPoint, and update on screen. That is, the main difference between all of the above approaches is that we'd have GL update the non-geographic positions itself on frame draw rather than the non-GL parts update them on some sort of (likely delayed and/or not as frequent) callback.
Activity
incanus commentedon Feb 17, 2015
Also of note is that the performance implications of not doing this in GL core itself will be small. At least on iOS, only one callout is present at a time (single selection) and just simply tracks on the map.
ljbade commentedon Feb 18, 2015
On Android the OS uses GL anyway to render/draw overlaid views so unlikely to be slower then rendering in our GL context.
incanus commentedon Feb 20, 2015
@1ec5 has been starting to look into this, tracking using
CADisplayLinkbut going to try @bleege's work on a "region is actively changing" delegate method in iOS.Pushed annotation class into mgl proper
incanus commentedon Mar 18, 2015
I'm grabbing this now to start on post-point annotations merge (#1021) since gestures, point-in-bounds, and platform-side callouts are all integrated.
incanus commentedon Mar 18, 2015
Annotation selection should work something like this. Note that unlike MapKit, the z-index of the selected marker doesn't change (that's in #991).
This is done with something like d53fb94, which just does a dumb
44pxbox around the touch for point-in-bounds querying, then iterates selection state through the close-by annotations. It doesn't take marker icon size into account; likely we'll want to make this box a bit larger and emphasize in the top direction.This is kind of like JS's
featuresAt(), since point annotations' tiles work like an R-Tree.incanus commentedon Mar 19, 2015
Summarizing state of popups. The tough nut to crack here is syncing pan and zoom — including decelerated coasting — between native iOS views and the GL view. We've tried this in three branches, with varying combos of
MGLAnnotationprotocol data objects or other placeholder markers.877-display-link— usingCADisplayLinkcallback to sync simpleUIImageViewmarkers with GL877-callout— bringing inSMCalloutViewpopups & updating position of it andUIImageViewmarkers using a newmbgl::MapChangeRegionIsChangingevent coming out of GL877-point-callout— same as above, but originally merging in GL-side point annotation work (@1ec5 I think we can fold this into the above branch now?)All have been updated to
masteras of ae7bd9a.The next approach I'm going to try is, since we're tracking annotations' positions GL-side, have GL update their screen position values every frame draw, and have Cocoa read out those values, translate to
CGPoint, and update on screen. That is, the main difference between all of the above approaches is that we'd have GL update the non-geographic positions itself on frame draw rather than the non-GL parts update them on some sort of (likely delayed and/or not as frequent) callback.1ec5 commentedon Mar 19, 2015
@incanus Yes, let’s fold 877-point-callout into 877-callout. That’ll make merging for 756-gps-marker easier.
111 remaining items
mapbox#894 - Closing InfoWindows when the map moves as alerted to via…
mapbox#894 - Adding snippet text to marker
mapbox#894 - Initial port of selected annotation api
mapbox#894 - Initial port of selectAnnotation and removing auto displ…
mapbox#894 - Moving annotation selection determination to onSingleTap…
mapbox#894 - Flipping the Y value to make screen touch event location…
mapbox#894 - Resetting height tolerance to 80
mapbox#894 - properly extend tap bounds for marker selection
mapbox#894 - flip marker tap bounds to be top-biased
mapbox#894 - remove debug polyline
mapbox#894 - add lat/lon to marker snippets
mapbox#894 - remove debug log
mapbox#894 - only select/deselect markers on true single-tap
Use MapView as parent for InfoWindow
Use MapView as parent for InfoWindow