Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Polygons with transparent fill not drawn properly when tilting camera #4852

Closed
Schumi09 opened this issue Apr 26, 2016 · 2 comments
Closed

Comments

@Schumi09
Copy link

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

  1. Used demo app
  2. 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));

  1. 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

broken_polygon

@ansis
Copy link
Contributor

ansis commented Apr 28, 2016

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: mapbox/mapbox-gl-js#1047

Switching from gl.LINES to gl.TRIANGLES rendering would fix this mapbox/mapbox-gl-js#2080

@Schumi09
Copy link
Author

Thanks for your reply. I already used the work-around ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants