Skip to content

Commit

Permalink
fix: set layout.visibility in style of VectorLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
boeckMt committed Mar 21, 2024
1 parent 9dc761e commit cb5faf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- Do not modify referenced objects when creating `StyleLayers` from `CustomLayer` or `VectorLayer.options.style` see also (cddf2fc6a83444851914ed6619bc8d5ada8ce485)
- Fix add layer with the correct beforeId on update `PaintProperty` workaround for [maplibre issue 3001](https://github.com/maplibre/maplibre-gl-js/issues/3001).
- Fix workaround that tried to get beforeId after layer was removed. Now use workaround only if `map.getTerrain()` is not not null.
- Fix set `layout.visibility` in style of `VectorLayer` based on `VectorLayer.visible`.

* **@dlr-eoc/map-cesium:**
- Fix get entity.name for infoBox in none GeoJson layers
Expand Down
11 changes: 4 additions & 7 deletions projects/map-maplibre/src/lib/maplibre-layers.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,19 @@ export function createTmsLayer<T extends ukisRasterLayer | ukisVectorLayer>(l: T
if(l?.options?.style){
const style = clone(l?.options?.style) as StyleSpecification;
style.layers.forEach(ls => {
(ls.metadata as any) = Object.assign(ls.metadata as any || {}, addUkisLayerMetadata(l));

// Set not visible on start
// TODO: ???
(ls.metadata as any) = Object.assign(ls.metadata as any || {}, addUkisLayerMetadata(l))
// Set not visible on start... This is not working with the new updateStyleLayerProperties
if (!ls.layout) {
ls.layout = {
visibility: 'none'
visibility: (l.visible) ? 'visible' : 'none'
}
} else {
ls.layout.visibility = 'none';
ls.layout.visibility = (l.visible) ? 'visible' : 'none'
}
});
layerSourceOrStyleSpecification = style as StyleSpecification;
// TODO: merge styles???
}

}
return layerSourceOrStyleSpecification;
}
Expand Down

0 comments on commit cb5faf2

Please sign in to comment.