From: Pierre-Luc Beaudoin Date: Sun, 24 Aug 2008 12:11:20 +0000 (-0400) Subject: Fix map-source property X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6772ebc894f03fac6717f547865335eef03a4e5;p=libchamplain Fix map-source property 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. --- diff --git a/champlain/champlainview.c b/champlain/champlainview.c index 91c6da2..ff1ed11 100644 --- a/champlain/champlainview.c +++ b/champlain/champlainview.c @@ -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);