Commit 53f9fb6e 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 2beeb8b3
Pipeline #286333 failed with stage
in 4 minutes and 47 seconds
......@@ -413,15 +413,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