-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make custom callout views easier to use [WIP] #4948
Conversation
This is still a big work-in-progress; b6c0c9f is my stopping point for tonight. My approach so far has been to go through with a machete, showing wanton disregard for backwards compatibility, but clearly we’ll have to address deprecation one way or another before this is ready to go. |
platform/ios/src/MGLCalloutView.h
Outdated
*/ | ||
- (void)calloutViewDidAppear:(UIView<MGLCalloutView> *)calloutView; | ||
@property (nonatomic, weak) id<MGLCalloutViewDelegate> delegate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is slated for removal.
Pushing this off of v3.3.0 — haven’t made enough progress and there’s a lot of other validation to do for that release. I may keep picking at this in the meantime, though. |
Please clarify if that means I have to allocate all the callout views for all the annotations on the map and keep those views in the memory even though user may never click on those? |
@andrewstay, by the time this feature lands, it’ll work similarly to annotation views. Callout views will go into a reuse queue, so the number of allocated views will be limited. |
New callout uses https://www.mapbox.com/ios-sdk/examples/custom-callout/ as a placeholder.
- Add `canShowCallout` and `callout` to non-multipoint annotation types - Temporarily make callouts non-tappable - Add `detailAccessoryView` (unused) - Break custom callout views
Also, include callout properties in object description.
a9941ed
to
042d720
Compare
This has been rebased onto the current |
So stale. Hopefully this will happen eventually! |
Following on from #4392, this pull request aims to simplify custom callout view creation and usage.
Changes
MGLCalloutView
protocol-detailAccessoryView
.MGLCalloutViewDelegate
MGLAnnotation
(Really, onlyMGLPointAnnotation
)-canShowCallout
boolean property.-calloutView
property that conforms toMGLCalloutView
protocol.MGLCompactCalloutView
SMCalloutView
with custom implementation.Todo
-[MGLMapView mapView:annotation:calloutAccessoryControlTapped:]
.MGLCalloutView.annotation
?title
andsubtitle
properties, maybe let the callout implementation do that directly with a passed-inannotation
.MGLMapView
for dead delegate methods; remove or deprecate.-mapView:annotationCanShowCallout:
-mapView:calloutViewForAnnotation:
-mapView:tapOnCalloutForAnnotation:
-mapView:rightCalloutAccessoryViewForAnnotation:
-mapView:leftCalloutAccessoryViewForAnnotation:
Stretch goals
MGLCalloutView
protocol.Enable callout views forPunted per Make custom callout views easier to use [WIP] #4948 (comment).MGLMultiPoint
(polylines, polygons)/cc @1ec5 @boundsj