Skip to content

Commit 8731bde

Browse files
Merge pull request #393 from PDOK/vectortiles-bug-webmercator
WebMercatorQuad didn't work in vectortile-viewer (frontend)
2 parents 8aee3d4 + 37e87f0 commit 8731bde

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

viewer/src/app/vectortile-view/vectortile-view.component.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,14 +357,9 @@ export class VectortileViewComponent implements OnChanges {
357357

358358
private setStyle(vectorTileLayer: VectorTileLayer<FeatureLike>) {
359359
if (this.styleUrl) {
360-
const projection = vectorTileLayer.getSource()?.getProjection()
361-
applyStyle(vectorTileLayer, this.styleUrl, undefined, undefined, this.calcResolutions(this.projection))
360+
applyStyle(vectorTileLayer, this.styleUrl, undefined, { updateSource: false }, this.calcResolutions(this.projection))
362361
.then(() => {
363-
//overrule source url and zoom from style
364-
if (this.tileUrl !== NetherlandsRDNewQuadDefault) {
365-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
366-
vectorTileLayer.setSource(this.getVectorTileSource(projection!, this.tileUrl))
367-
}
362+
this.logger.log('style applied for: ' + this.id)
368363
})
369364
.catch(err => this.logger.error('error loading: ' + this.id + ' ' + this.styleUrl + ' ' + err))
370365
} else {

0 commit comments

Comments
 (0)