diff options
author | Jonas Danielsson <jonas@threetimestwo.org> | 2013-12-04 13:51:28 +0100 |
---|---|---|
committer | Jiří Techet <techet@gmail.com> | 2013-12-06 01:01:32 +0100 |
commit | 6c26dc2a7f07550c5dc960c32b31de398975c01e (patch) | |
tree | 7ad8f47c24c6bf95c11ced019574014e3567fb62 | |
parent | 9033f82ff09a426ec393a33b7befff3c7f22130c (diff) | |
download | libchamplain-6c26dc2a7f07550c5dc960c32b31de398975c01e.tar.gz |
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
-rw-r--r-- | 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) |