Polygons with transparent fill not drawn properly when tilting camera
Hi there,
polygons that have a transparent fill are not drawn properly when tilting the camera.
Platform: Android 4.4.2 (Sony Xperia P) Mapbox SDK version: 4.0.0, 4.1.0-SNAPSHOT
Steps to trigger behavior
- Used demo app
- Set new Cameraposition with tilt
CameraPosition cameraPosition = new CameraPosition.Builder() .target(new LatLng(51.963493, 7.617811)) .zoom(15) .tilt(30) .build(); mMapboxMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
- Set up a polygon with transparent fill, e.g.:
mapboxMap.addPolygon(new PolygonOptions().add(new LatLng(51.963493, 7.617811)).add(new LatLng(51.964233, 7.620922)).add(new LatLng(51.965575, 7.617070)).fillColor(Color.parseColor("#00000000")) .strokeColor(Color.parseColor("#ff000000")));
Expected behavior
Properly drawn polygons as it is without tilted camera, before 4.0.0 it worked fine I think. I did not test it again, but I'm pretty sure.
Actual behavior

You can work around this issue by using adding a line instead of a polygon.
Polygon outlines are drawn with gl.LINES instead of gl.TRIANGLES. The interpolation between vertices does not work the way we expected it to. The -gl-js version of this issue: https://github.com/mapbox/mapbox-gl-js/issues/1047
Switching from gl.LINES to gl.TRIANGLES rendering would fix this https://github.com/mapbox/mapbox-gl-js/issues/2080
Thanks for your reply. I already used the work-around ;)