WhirlyGlobe icon indicating copy to clipboard operation
WhirlyGlobe copied to clipboard

[iOS] Displaying polygons with opacity

Open DaTa opened this issue 5 years ago • 2 comments

Hi guys, recently, I tried displaying some polygons (forest and grass from OpenStreetMap) that had opacity set to 0.45 (styled by Mapbox GL). unfortunately, the result didn't look as good as I was hoping it will - polygons overlap at the edges of tiles. pls see for yourself:

Simulator Screen Shot - iPhone 11 Pro - 2020-10-12 at 23 07 33

I'm setting opacity because I would like to display another base map underneath this later on... when polygons are solid color, the overlaps are not visible, of course.

so far, tried changing variousMaplyQuadPagingLayer's settings and also MaplyVectorStyleSettings's properties, but it didn't really help... anyone experienced this? wondering, is there something I could try to fix this?

thank you for your suggestions!

DaTa avatar Oct 12 '20 21:10 DaTa

It's because the polygons are transparent. A lot of style sheets will use transparency to build an effect for each tile. Vector tile data tends to overlap for its own reasons. So you get these visual overlaps.

The solution is to render a background polygon per tile and order the tile IDs ahead of drawPriority.
At this point, none of our paying clients have asked for that, so we haven't yet done it.

mousebird avatar Oct 13 '20 17:10 mousebird

oki, thank you for your answer, mousebird. was hoping it's just some configuration issue...

anyways, managed to get similar result with a solid vector base layer and semi-transparent raster layer on top of it (using layer's fade property).

btw. thanks for taking care of this awesome open source project!

DaTa avatar Oct 19 '20 21:10 DaTa