[gnome-maps/wip/mlundblad/remove-dark-street-and-hybrid-aerial: 2/6] mapView: Remove support for dark and hybrid aerial
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/remove-dark-street-and-hybrid-aerial: 2/6] mapView: Remove support for dark and hybrid aerial
- Date: Sun, 26 Jun 2022 20:11:07 +0000 (UTC)
commit f4a5a884d89589ffa124f14e486b9c24c9323171
Author: Marcus Lundblad <ml dfupdate se>
Date: Sun Jun 26 21:51:37 2022 +0200
mapView: Remove support for dark and hybrid aerial
Removes the support for dark street and hybrid aerial
tile sets, as we haven't had these enabled for some time
now. This should make porting to Shumate easier.
src/mapView.js | 55 ++++---------------------------------------------------
1 file changed, 4 insertions(+), 51 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index b02eeda4..fc28dc50 100644
--- a/src/mapView.js
+++ b/src/mapView.js
@@ -180,18 +180,6 @@ export class MapView extends GtkChamplain.Embed {
}
});
- // if dark tiles is available, setup handler to switch style
- if (Service.getService().tiles.streetDark) {
- Handy.StyleManager.get_default().connect('notify::dark',
- this._onDarkChanged.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));
- }
-
Application.settings.connect('changed::show-scale',
this._onShowScaleChanged.bind(this));
@@ -199,30 +187,6 @@ export class MapView extends GtkChamplain.Embed {
return view;
}
- _onDarkChanged() {
- if (this._mapType === MapType.STREET) {
- let overlay_sources = this.view.get_overlay_sources();
-
- if (Handy.StyleManager.get_default().dark)
- 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));
- }
- }
-
/* create and store a route layer, pass true to get a dashed line */
_createRouteLayer(dashed, lineColor, width) {
let red = Color.parseColor(lineColor, 0);
@@ -346,21 +310,10 @@ export class MapView extends GtkChamplain.Embed {
if (mapType !== MapView.MapType.LOCAL) {
let tiles = Service.getService().tiles;
- if (mapType === MapView.MapType.AERIAL && tiles.aerial) {
- if (tiles.hybridAerial &&
- Application.settings.get('hybrid-aerial')) {
- this.view.map_source = MapSource.createHybridAerialSource();
- } else {
- this.view.map_source = MapSource.createAerialSource();
- }
- } else {
- if (tiles.streetDark &&
- Handy.StyleManager.get_default().dark) {
- this.view.map_source = MapSource.createStreetDarkSource();
- } else {
- this.view.map_source = MapSource.createStreetSource();
- }
- }
+ if (mapType === MapView.MapType.AERIAL && tiles.aerial)
+ this.view.map_source = MapSource.createAerialSource();
+ else
+ this.view.map_source = MapSource.createStreetSource();
Application.settings.set('map-type', mapType);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]