[gnome-maps/wip/mlundblad/refresh-shapelayers] mapView: Refresh shape layers when switching night mode and hybrid aerial



commit 8afea96725c0e0a102e08bc05248f4a1c594f6e7
Author: Marcus Lundblad <ml update uu se>
Date:   Thu Jun 25 23:02:07 2020 +0200

    mapView: Refresh shape layers when switching night mode and hybrid aerial

 src/mapView.js | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/mapView.js b/src/mapView.js
index 77f26f18..d14b678a 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -258,19 +258,25 @@ var MapView = GObject.registerClass({
 
     _onNightModeChanged() {
         if (this._mapType === MapType.STREET) {
+            let overlay_sources = this.view.get_overlay_sources();
+
             if (Application.settings.get('night-mode'))
                 this.view.map_source = MapSource.createStreetDarkSource();
             else
                 this.view.map_source = MapSource.createStreetSource();
+            overlay_sources.forEach((source) => this.view.add_overlay_source(source, 255));
         }
     }
 
     _onHybridAerialChanged() {
         if (this._mapType === MapType.AERIAL) {
+            let overlay_sources = this.view.get_overlay_sources();
+
             if (Application.settings.get('hybrid-aerial'))
                 this.view.map_source = MapSource.createHybridAerialSource();
             else
                 this.view.map_source = MapSource.createAerialSource();
+            overlay_sources.forEach((source) => this.view.add_overlay_source(source, 255));
         }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]