0
votes

I am using OpenLayers 6 to display two MVT tile sources as two layers. The base layer has an MVT source from a local service serving an OpenMapTiles mbtile file, using the osm-bright style supplied with the file. The second source is a MVT layer coming from a Tegola service.

When only the base layer is displayed, the base map labels are rendered correctly. When the second layer is added, the base map labels no longer display.

Is this a bug, or is there some other setting that needs to be applied?

1
See "New declutter behavior" in the release notes github.com/openlayers/openlayers/releasesMike
I'm not sure how to make use of that change in declutter behaviour , or even it it is the problem. I tried all combinations of declutter: true and false on the two layers defined, but none of them resulted in the labels on the lowest layer displaying. I also tried replacing the complex Mapbox CSS style with a simple OL style with a label, and it had exactly the same behaviour.dr_jts
You might be seeing a zIndex issue similar to this github.com/openlayers/openlayers/issues/10096Mike
Yes, that was the problem. Now fixed by using a different classname as recommended in that ticket. Thanks!dr_jts

1 Answers

0
votes

The problem is caused by a current problem with OL6, described and answered in this issue.

The fix is to specify a different className for the second VectorTile layer object added to the map. When this is done the labels on the base map vector tile layer are displayed.