diff options
author | Marcus Lundblad <ml@dfupdate.se> | 2022-12-07 22:19:04 +0100 |
---|---|---|
committer | Marcus Lundblad <ml@dfupdate.se> | 2023-01-02 00:16:30 +0100 |
commit | bced48bca88943d91baad7e4eca39672f4d83008 (patch) | |
tree | ab7ad8e89ffc09e97161606129c0db3fa9e03ec7 | |
parent | c9d5cf6115db25f35b8a04d812ee31b8ebbe512e (diff) | |
download | gnome-maps-bced48bca88943d91baad7e4eca39672f4d83008.tar.gz |
shapeLayer: Recreate overlay layer on zoom change
This is a workaround to avoid blurred-out copies
of the lines from previous zoom levels.
-rw-r--r-- | src/shapeLayer.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/shapeLayer.js b/src/shapeLayer.js index d027b062..34a0d2d9 100644 --- a/src/shapeLayer.js +++ b/src/shapeLayer.js @@ -64,6 +64,16 @@ export class ShapeLayer extends GObject.Object { this._overlayLayer = new Shumate.MapLayer({ map_source: this._mapSource, viewport: this._mapView.map.viewport }); + this._zoomId = this._mapView.map.viewport.connect('notify::zoom-level', () => { + let oldOverlayLayer = this._overlayLayer; + + this._overlayLayer = + new Shumate.MapLayer({ map_source: this._mapSource, + viewport: this._mapView.map.viewport }); + this._overlayLayer.visible = this._visible; + this._mapView.map.add_layer(this._overlayLayer); + this._mapView.map.remove_layer(oldOverlayLayer); + }); } get bbox() { @@ -114,6 +124,7 @@ export class ShapeLayer extends GObject.Object { unload() { this._mapView.map.remove_layer(this._markerLayer); this._mapView.map.remove_layer(this._overlayLayer); + this._mapView.map.viewport.disconnect(this._zoomId); } } |