[gnome-maps/wip/mlundblad/auto-disable-aerial: 74/74] mainWindow: Don't activate aerial view when unavailable



commit 15dd4886896c5aed4f12dcf8dbe429d4949463de
Author: Marcus Lundblad <ml update uu se>
Date:   Thu Nov 9 22:39:14 2017 +0100

    mainWindow: Don't activate aerial view when unavailable

 src/mainWindow.js |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 2adc421..076d22b 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -482,8 +482,11 @@ var MainWindow = GObject.registerClass({
     }
 
     _onAerialViewActivate() {
-        this._mapView.setMapType(MapView.MapType.AERIAL);
-        this.layersPopover.setMapType(MapView.MapType.AERIAL);
+        // don't attempt to switch to aerial if we don't have tiles for it
+        if (Service.getService().tiles.aerial) {
+            this._mapView.setMapType(MapView.MapType.AERIAL);
+            this.layersPopover.setMapType(MapView.MapType.AERIAL);
+        }
     }
 
     _onToggleSidebarChangeState(action, variant) {


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