]> err.no Git - libchamplain/commitdiff
Fix map-source property
authorPierre-Luc Beaudoin <pierre-luc@squidy.info>
Sun, 24 Aug 2008 12:11:20 +0000 (08:11 -0400)
committerPierre-Luc Beaudoin <pierre-luc@squidy.info>
Sun, 24 Aug 2008 12:11:20 +0000 (08:11 -0400)
When switching, the current zoom level is saved and
reapplied to the new source, there were not check
if the new source supported such a zoom level.

champlain/champlainview.c

index 91c6da23837204c00fffc5da1faf645e8f6d60e9..ff1ed117dc453642146b68f9d115abfc0e17367a 100644 (file)
@@ -223,6 +223,10 @@ champlain_view_set_property(GObject* object, guint prop_id, const GValue* value,
                 gint currentLevel = priv->map->current_level->level;
                 map_free(priv->map);
                 priv->map = map_new(priv->mapSource);
+                
+                if (currentLevel > priv->map->zoom_levels)
+                  currentLevel = priv->map->zoom_levels;
+                  
                 map_load_level(priv->map, currentLevel);
                 map_load_visible_tiles (priv->map, priv->viewportSize);
                 clutter_container_add_actor (CLUTTER_CONTAINER (priv->viewport), priv->map->current_level->group);