diff --git a/lib/maps-file-data-source.c b/lib/maps-file-data-source.c index 2e326f5893af378d06249c873dc68619d1789134..40a3f91be62cbc3709c9d2ef619de7e0a6ae7ceb 100644 --- a/lib/maps-file-data-source.c +++ b/lib/maps-file-data-source.c @@ -470,15 +470,14 @@ on_file_load (GObject *source_object, FillTileData *data = g_task_get_task_data (task); char *contents; gsize length; - GBytes *bytes; g_file_load_contents_finish (data->file, res, &contents, &length, NULL, NULL); if (contents != NULL) { - bytes = g_bytes_new_take (contents, length); + data->bytes = g_bytes_new_take (contents, length); g_signal_emit_by_name (data->self, "received-data", data->x, data->y, data->z, data->bytes); - g_task_return_pointer (task, g_steal_pointer (&bytes), (GDestroyNotify)g_bytes_unref); + g_task_return_pointer (task, g_steal_pointer (&data->bytes), (GDestroyNotify)g_bytes_unref); } } diff --git a/src/application.js b/src/application.js index 5e2172013cc36c0cf8dec40fded78c94c2cf3829..41fb76b3d42cb0dbb8cf7837267210124f879f3e 100644 --- a/src/application.js +++ b/src/application.js @@ -305,7 +305,7 @@ export class Application extends Adw.Application { if (options.contains('local')) { let variant = options.lookup_value('local', null); this.local_tile_path = variant.deep_unpack(); - normalStartup = false; + Application.normalStartup = false; if (options.contains('local-tile-size')) { variant = options.lookup_value('local-tile-size', null); this.local_tile_size = variant.deep_unpack(); diff --git a/src/mapView.js b/src/mapView.js index 1bc55289f00773d4e5d82fd1c09fcadb770a6ed9..14b1153895e68b5ffee491174933d65f4e533c6b 100644 --- a/src/mapView.js +++ b/src/mapView.js @@ -446,9 +446,7 @@ export class MapView extends Gtk.Overlay { Application.settings.set('map-type', mapType); } else { let source = new GnomeMaps.FileDataSource({ - path: Utils.getBufferText(Application.application.local_tile_path), - renderer: renderer, - tile_size: Application.application.local_tile_size || 512 + path: Utils.getBufferText(Application.application.local_tile_path) }); try { source.prepare(); @@ -456,8 +454,8 @@ export class MapView extends Gtk.Overlay { mapSource = new Shumate.RasterRenderer({ id: 'local', name: 'local', - min_zoom_level: source.min_zoom_level, - max_zoom_level: source.max_zoom_level, + min_zoom_level: source.min_zoom, + max_zoom_level: source.max_zoom, tile_size: Application.application.local_tile_size ?? 512, projection: Shumate.MapProjection.MERCATOR, data_source: source }); @@ -465,6 +463,7 @@ export class MapView extends Gtk.Overlay { this.setMapType(MapView.MapType.STREET); Application.application.local_tile_path = false; Utils.showDialog(e.message, Gtk.MessageType.ERROR, this._mainWindow); + return; } }