Commit 84fc4b2a authored by Marcus Lundblad's avatar Marcus Lundblad
Browse files

mapView: Don't try to set aerial tiles if not available

Safe-guard agains setting the aerial tile source
if it's not available in the service file.
This avoid a crash if aerial was saved as last-used
map type in gsettings and at next startup the service
has dropped support.
parent 536ae6ee
Pipeline #286331 passed with stages
in 12 minutes and 20 seconds
...@@ -417,15 +417,17 @@ var MapView = GObject.registerClass({ ...@@ -417,15 +417,17 @@ var MapView = GObject.registerClass({
this._mapType = mapType; this._mapType = mapType;
if (mapType !== MapType.LOCAL) { if (mapType !== MapType.LOCAL) {
if (mapType === MapType.AERIAL) { let tiles = Service.getService().tiles;
if (Service.getService().tiles.hybridAerial &&
if (mapType === MapType.AERIAL && tiles.aerial) {
if (tiles.hybridAerial &&
Application.settings.get('hybrid-aerial')) { Application.settings.get('hybrid-aerial')) {
this.view.map_source = MapSource.createHybridAerialSource(); this.view.map_source = MapSource.createHybridAerialSource();
} else { } else {
this.view.map_source = MapSource.createAerialSource(); this.view.map_source = MapSource.createAerialSource();
} }
} else { } else {
if (Service.getService().tiles.streetDark && if (tiles.streetDark &&
Application.settings.get('night-mode')) { Application.settings.get('night-mode')) {
this.view.map_source = MapSource.createStreetDarkSource(); this.view.map_source = MapSource.createStreetDarkSource();
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment