[gnome-maps/gnome-43] mapView: Fix initializing local tile data source
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-maps/gnome-43] mapView: Fix initializing local tile data source
- Date: Thu, 22 Sep 2022 19:21:53 +0000 (UTC)
commit b5cbc1108ad639751bfd90679c41124f654b798a
Author: Marcus Lundblad <ml dfupdate se>
Date:   Tue Sep 13 23:11:18 2022 +0200
    mapView: Fix initializing local tile data source
    
    Remove reference to non-existing variable "renderer".
    Use the correct zoom level properties from the file data source.
 src/mapView.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/mapView.js b/src/mapView.js
index 1bc55289..14b11538 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;
             }
         }
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]