-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[iOS] Distorted polygons at certain zoom level #3260
Comments
Can you provide the coordinates for one of these examples? |
Sure, for the second one (lat, long): |
/cc @mourner |
@kkaefer earcut is not merged into master yet, so this must be libtess/clipper-related, right? |
Or geojson-vt-cpp related. |
For the record, these coords work fine on GL JS. Now need to dig into native... |
GeoJSON-VT C++ debug viz also seems fine on these coordinates. |
It's hard to reproduce in a clear way and give you some path. Maybe more details will be helpful. In my case map view has many filled polygons. Usually there is one big polygon which represents some kind of city area. Inside that polygon are placed smallest polygons like the ones I presented above. Above certain zoom level inner polygons are OK, but when I zoom in, some of them changes their shape like in attached screens. It does not occur always to the specific polygon; sometimes everything is OK, sometimes not. I'm not sure if this is related issue, but I also got this crash very often: #2926 |
Interesting. @BFTE does the same thing (plus the crash) happen with the master version of mapbox-gl-native? |
I could not check, I got some errors building static lib from sources (e81f3f3) using make ipackage:
|
Hi, still getting this issue when zooming in ios-v3.1.0-pre.1 (556690f), dynamic framework linked: |
I meet the same bug and find get the solution in the end. How to reproduceIn swift my project, I store the polygon point array in a array
convert array to How to fix itFirst way: create a new array and cope the original array to the new array, so we can use the new array as the official demo
Second way: in the array of our class, add whyIt is special about the Anyone know that is way detailed? |
#3074 seems to have been the issue for me - I was not closing my paths. Odd how it appears to work fine.. I do notice the documentation says that a polygon is a closed path, but the data I had used with Google Maps to create polygons didn't have the repeated coordinate at the end, and when I started displaying polygons it worked fine without checking for it / adding it in. I might update documentation to reflect that a closed path is a requirement or behavior may be undefined. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Below some zoom level I add to map view set of MGLPolygon objects (sometimes more than 50) with correct GeoJSON. Everything works great until I start zooming in/out. At certain zoom level some polygons are getting distorted, when I zoom out polygons back to correct shape. I did screenshots for better understanding. It does not happen every time when I zoom in, but sometimes and I have no idea what is the reason of this behaviour.
To add polygons to map I use map view methods (on both there is the same problem):
addAnnotataions: or addOverlays:
Using latest sdk release: ios-v3.0.1, but in earlier versions this problem also occurs.
Thanks!
The text was updated successfully, but these errors were encountered: