clutter_container_foreach(CLUTTER_CONTAINER(priv->user_layers), CLUTTER_CALLBACK(layer_reposition_cb), view);
}
+static void
+create_initial_map(ChamplainView *view)
+{
+ ChamplainViewPrivate *priv = CHAMPLAIN_VIEW_GET_PRIVATE (view);
+ priv->map = map_new(priv->map_source);
+ map_load_level(priv->map, priv->zoom_level);
+ clutter_container_add_actor (CLUTTER_CONTAINER (priv->map_layer), priv->map->current_level->group);
+
+ marker_reposition(view);
+
+ g_object_notify(G_OBJECT(view), "zoom-level");
+ g_object_notify(G_OBJECT(view), "map-source");
+}
+
static void
resize_viewport(ChamplainView *view)
{
if(!priv->map)
{
- priv->map = map_new(priv->map_source);
- map_load_level(priv->map, priv->zoom_level);
- clutter_container_add_actor (CLUTTER_CONTAINER (priv->map_layer), priv->map->current_level->group);
-
- marker_reposition(view);
-
- g_object_notify(G_OBJECT(view), "zoom-level");
- g_object_notify(G_OBJECT(view), "map-source");
+ create_initial_map(view);
}
clutter_actor_set_size (priv->finger_scroll, priv->viewport_size.width, priv->viewport_size.height);
{
ChamplainViewPrivate *priv = CHAMPLAIN_VIEW_GET_PRIVATE (view);
+ if(!priv->map)
+ {
+ create_initial_map(view);
+ }
+
gdouble x, y;
x = priv->map->longitude_to_x(priv->map, longitude, priv->map->current_level->level);
y = priv->map->latitude_to_y(priv->map, latitude, priv->map->current_level->level);