Commit b44c0040 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 3fe5d5e4
Pipeline #286332 failed with stage
in 7 minutes and 2 seconds
......@@ -416,15 +416,17 @@ var MapView = GObject.registerClass({
this._mapType = mapType;
if (mapType !== MapType.LOCAL) {
if (mapType === MapType.AERIAL) {
if (Service.getService().tiles.hybridAerial &&
let tiles = Service.getService().tiles;
if (mapType === 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 (Service.getService().tiles.streetDark &&
if (tiles.streetDark &&
Application.settings.get('night-mode')) {
this.view.map_source = MapSource.createStreetDarkSource();
} 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