Skip to content

Commit c47daee

Browse files
committed
fix(map-ol): allow to update tms vector layer with no style set
1 parent 73b3d7f commit c47daee

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
* **@dlr-eoc/map-ol:**
5454
- Use 8 stops for all OpenLayers `transformExtent()` functions to sample more points along the edges for better results. Should have only minimal perf hit. This corrects some calculations of extents from WGS84 to other projections. For example, in `setProjection`, new extents for layers are more precise and layers are no longer clipped.
55+
- Allow to update `tms` vector layer with no style set.
5556

5657
### Features
5758
- Remove `standalone: true` Angular directives, components and pipes are now standalone by default since version 19.

projects/map-ol/src/lib/map-ol.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,11 @@ export class MapOlComponent implements OnInit, AfterViewInit, AfterViewChecked,
295295

296296
private updateTmsLayerParamsWith(oldLayer: olVectorLayer<VectorSource>, newLayer: Layer) {
297297
if (newLayer instanceof VectorLayer) {
298-
const style = newLayer.options.style;
299-
const mapboxSourceKey = newLayer.options.styleSource;
300-
applyStyle(oldLayer, style, mapboxSourceKey);
298+
if (newLayer.options) {
299+
const style = newLayer.options.style;
300+
const mapboxSourceKey = newLayer.options.styleSource;
301+
applyStyle(oldLayer, style, mapboxSourceKey);
302+
}
301303
}
302304
}
303305

0 commit comments

Comments
 (0)