-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stretchable UIImage support seems to be broken #381
Comments
Also, the |
I wanted to provide an image depicting the behavior @avi-c mentioned above: |
On the latest versions of the Maps SDK beta we are actually seeing different issues than that one, but both point to errors in the image stretching. Right now we see incorrect anchoring of the annotations. If you look at the image below you will see that the pin should be anchored on the route line but instead it is anchored further up the base/stem of the annotation. This used to work as expected in earlier betas. |
The image that @ZiZasaurus posted above shows the weird shaped annotations because the image is being stretched at the wrong pixel offset into the original asset, so the stem portion is being stretched when only the middle should be. |
The primary issue is that when using iconTextFit, the textAnchor takes precedence and overrides the iconAnchor. On top of that, some of the expressions didn't seem to be working as expected. I think |
This is also impacting mapbox/mapbox-navigation-ios#3177. /cc: @knov |
As per #548
|
Reopening as there seems to be more to it |
Closing as stale anyway. |
But does it still occur? |
@cmilack @evil159 I think it’s a bit more nuanced than that. As #381 (comment) shows, the developer basically has a choice between anchoring the symbol on the correct location (resulting in a misshapen icon) or stretching the correct portion of the icon (resulting in a misplaced icon), but not both. I think this is suboptimal for the use case of displaying a 💬-like symbol. If that is no longer one of the intended use cases for |
Confirmed that the issue still reproduces: mapbox/mapbox-navigation-ios#2928 (comment). |
Environment
Observed behavior and steps to reproduce
The Nav SDK started seeing some issues with the route duration annotations being implemented here: mapbox/mapbox-navigation-ios#2996. These issues are also seen in the simpler PR for adding a new example to the Maps SDK sample app: #190.
The issues are around the
icon-anchor
andtext-anchor
properties seeming to regress somewhere between when I first put up the sample PR and now. @nishant-karajgikar and I spent a lot of time debugging this. Our shared assumption was that the issue lay either in my use of the runtime styling expressions or in the SDK expression logic itself.After looking at it for a while and even eliminating the use of data-driven styling, the main issues remained. We came to the conclusion that the issues are likely to be in how the SDK handles generating the GL stretchable images from the UIImage interface provided in the iOS Maps SDK.
#190 contains an animated GIF of how this should look, mainly that the annotations are clearly visually anchored properly with the tip of the annotation staying attached to the map at the same spot. If you build and try the same sample in this branch:
ac-AnnotationStylingRedux
you will see that the visual behavior is now incorrect and the anchors are not maintained properly.The text was updated successfully, but these errors were encountered: