-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Second polyline with identical coordinates not rendered #7811
Comments
Could you perhaps post code that reproduces this issue? Modifying our our test shapes example to start/end on the same coordinate works as expected: |
self.mapView.addOverlays(lines) Basically this is what I do, (I need to spend some time to test with a hardcoded line so I can get a better code snippet but a bit pressed for time right now). But if the line has identical start/ends it will not show up, and will not even ask for their styling (strokeColorForShapeAnnotation or lineWidthForPolylineAnnotation) If i remove the last coordinate it works every time as expected. In 3.3.7 there are no problems with this. I am drawing fairly short lines (indoor maps for a building) if that changes anything. |
Right, after further testing it seems that its not lines that start and end at the same place, its polylines that perfectly matches a polygons outline that disappear (no calls for stroke color etc). edit: Potentially its also because rendering order of overlays has changed? |
We're experiencing the same issue. The actual use-case is that we want to draw a polyline with an outline and we do that by adding two polylines: one wider on the back and then another one on top. They both have the same coords. I've identified that the issue is this line here mapbox-gl-native/platform/ios/src/MGLMapView.mm Line 2936 in 62ea1f2
Introduced here: 751aff2 cc @boundsj This line prevent from adding two annotation that has the same set of coords. Comparator for polyline objects (and for other annotation types too) compares the actual coords one by one, I think author's intention was to compare only references to prevent two same objects being added. |
Thanks for digging into this @kmagiera! I'll put this on the our 3.5.0 release milestone. In the meantime, using the runtime styling API introduced in the Mapbox iOS SDK release 3.4.0 should not suffer from the same issue and would offer you many more styling options -- a single feature can visualized with multiple style layers. |
Cool! thanks for a prompt response. In the meantime just wanted to post about the workaround that we use for polylines: we add one polyline with coords in a normal order and then the second polyline with coords in a reversed order. This prevents |
Thanks for tracking this down! This line used to be innocuous, but #6559 implemented custom
@kmagiera, another workaround is to vary the |
A compounding factor is that |
Fixed in #8355 on the release-v3.5.0-android-v5.0.0 branch. |
Platform: iOS 10.2
Mapbox SDK version: 3.4
Steps to trigger behavior
Expected behavior
Polyline visible on map
Actual behavior
Polyline does not added to map
The text was updated successfully, but these errors were encountered: