[gnome-maps/wip/mlundblad/aerial-hybrid: 4/5] mapView: Use hybrid aerial tiles when enabled
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/aerial-hybrid: 4/5] mapView: Use hybrid aerial tiles when enabled
- Date: Sun, 21 Jun 2020 10:17:50 +0000 (UTC)
commit 49b137f2c54e16e2c69086ac7bba3ad40d1ebab8
Author: Marcus Lundblad <ml update uu se>
Date: Sun Jun 21 09:47:31 2020 +0200
mapView: Use hybrid aerial tiles when enabled
src/mapView.js | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index 544ef46a..77f26f18 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -205,6 +205,12 @@ var MapView = GObject.registerClass({
this._onNightModeChanged.bind(this));
}
+ // if hybrid aerial tiles are available, setup handler to toggle
+ if (Service.getService().tiles.hybridAerial) {
+ Application.settings.connect('changed::hybrid-aerial',
+ this._onHybridAerialChanged.bind(this));
+ }
+
this._gtkSettings = Gtk.Settings.get_default();
this._gtkSettings.connect('notify::gtk-application-prefer-dark-theme',
this._onPreferDarkThemeChanged.bind(this));
@@ -259,6 +265,15 @@ var MapView = GObject.registerClass({
}
}
+ _onHybridAerialChanged() {
+ if (this._mapType === MapType.AERIAL) {
+ if (Application.settings.get('hybrid-aerial'))
+ this.view.map_source = MapSource.createHybridAerialSource();
+ else
+ this.view.map_source = MapSource.createAerialSource();
+ }
+ }
+
/* create and store a route layer, pass true to get a dashed line */
_createRouteLayer(dashed, lineColor, width) {
let red = Color.parseColor(lineColor, 0);
@@ -381,7 +396,12 @@ var MapView = GObject.registerClass({
if (mapType !== MapType.LOCAL) {
if (mapType === MapType.AERIAL) {
- this.view.map_source = MapSource.createAerialSource();
+ if (Service.getService().tiles.hybridAerial &&
+ Application.settings.get('hybrid-aerial')) {
+ this.view.map_source = MapSource.createHybridAerialSource();
+ } else {
+ this.view.map_source = MapSource.createAerialSource();
+ }
} else {
if (Service.getService().tiles.streetDark &&
Application.settings.get('night-mode')) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]