[libchamplain] view: notify max/min-zoom-level on set_map_source



commit 6c26dc2a7f07550c5dc960c32b31de398975c01e
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Wed Dec 4 13:51:28 2013 +0100

    view: notify max/min-zoom-level on set_map_source
    
    When setting a new map_source we change the vie max/min-zoom-level
    but we do not make sure they get notified.
    
    This patchs sets them using champlain_view_set_[max|min]_zoom_level
    to ensure this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719840

 champlain/champlain-view.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 0033af3..4f132d8 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -2185,6 +2185,8 @@ champlain_view_set_map_source (ChamplainView *view,
       CHAMPLAIN_IS_MAP_SOURCE (source));
 
   ChamplainViewPrivate *priv = view->priv;
+  guint source_min_zoom;
+  guint source_max_zoom;
 
   if (priv->map_source == source)
     return;
@@ -2195,8 +2197,10 @@ champlain_view_set_map_source (ChamplainView *view,
   g_list_free_full (priv->overlay_sources, g_object_unref);
   priv->overlay_sources = NULL;
 
-  priv->min_zoom_level = champlain_map_source_get_min_zoom_level (priv->map_source);
-  priv->max_zoom_level = champlain_map_source_get_max_zoom_level (priv->map_source);
+  source_min_zoom = champlain_map_source_get_min_zoom_level (priv->map_source);
+  champlain_view_set_min_zoom_level (view, source_min_zoom);
+  source_max_zoom = champlain_map_source_get_max_zoom_level (priv->map_source);
+  champlain_view_set_max_zoom_level (view, source_max_zoom);
 
   /* Keep same zoom level if the new map supports it */
   if (priv->zoom_level > priv->max_zoom_level)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]