]> Pileus Git - grits/blobdiff - src/objects/grits-tile.c
Load tiles at a lower resolution
[grits] / src / objects / grits-tile.c
index 736e374df12812826bb053e30357994c72fe1267..f536c96d496fd99d4f04cfbafdaf668f8745db59 100644 (file)
@@ -126,6 +126,7 @@ static gboolean _grits_tile_precise(GritsPoint *eye, GritsBounds *bounds,
         * (yet?) test if the tile would be drawn */
        gdouble scale = eye->elev / min_dist;
        view_res /= scale;
+       view_res *= 1.8;
        //view_res /= 1.4; /* make it a little nicer, not sure why this is needed */
        //g_message("tile=(%7.2f %7.2f %7.2f %7.2f) "
        //          "eye=(%9.1f %9.1f %9.1f) "
@@ -215,14 +216,17 @@ void grits_tile_update(GritsTile *tile, GritsPoint *eye,
                return;
        }
 
-       /* Need more resolution, split tile and update recursively */
-       if (!tile->children[0][0]) {
-               switch (tile->proj) {
-               case GRITS_PROJ_LATLON:   _grits_tile_split_latlon(tile);   break;
-               case GRITS_PROJ_MERCATOR: _grits_tile_split_mercator(tile); break;
+       /* Split tile if needed */
+       grits_tile_foreach(tile, child) {
+               if (child == NULL) {
+                       switch (tile->proj) {
+                       case GRITS_PROJ_LATLON:   _grits_tile_split_latlon(tile);   break;
+                       case GRITS_PROJ_MERCATOR: _grits_tile_split_mercator(tile); break;
+                       }
                }
        }
 
+       /* Update recursively */
        grits_tile_foreach(tile, child) {
                GRITS_OBJECT(child)->hidden = FALSE;
                grits_tile_update(child, eye, res, width, height,