[gnome-maps/wip/mlundblad/fix-local-tiles: 9/10] mapView: Fix initializing local tile data source




commit 0c4769ea507de4b4847375268b8d9ed062d9260a
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]