[ios] Use transparent image for annotations backed by views#5461
Conversation
|
A bit kludgy, but this is exactly what I had in mind. The benefit of leaving mbgl responsible for these annotation views’ positions is that, in the future, it might be possible for annotation views to collide out labels, for instance. (That would require us to vary the spacer image’s size by the view’s size, but that isn’t necessary just yet.)
Does #5165 address any other issues like #5151? If not, then it’s fine to leave that for 3.4.0. |
There was a problem hiding this comment.
Is this creating an image with width/height 1/1 and using this in core as image for the pointannotation? As far as I can see this is the same hack I'm using on Android: https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java#L299
The current implementation of view backed annotations mostly relies
on the existing annotation model manager and the associated underlying
boost query implementations for annotation management. However, since
the representation of the model is a view, an image was not installed
for view backed annotations. Because the underlying annotation
management implementation is not entire comfortable working without
an image, it would report
`[INFO] {Worker}[Sprite]: Can't find sprite named 'default_marker'`
when annotation models without an image were encountered.
This updates the annotation adding logic in to create (or reuse) and
install a small, invisible image for each view backed annotation.
88aa2ab to
cae73ac
Compare
The current implementation of view backed annotations mostly relies on the existing annotation model manager and the associated underlying boost query implementations for annotation management. However since, in the case of view backed annotations, the representation of the model is a UIView, an image was not installed. Because the underlying annotation management implementation is not entirely comfortable working without an image, it would report
[INFO] {Worker}[Sprite]: Can't find sprite named 'default_marker'when annotation models without an image were encountered.This updates the annotation adding logic to create (or reuse) and install a small, invisible image for each view backed annotation.
This stops the issue noted in #5210 for iOS.
cc @1ec5