ChamplainMapSource map_source;
gint zoom_level; // only used when the zoom-level property is set before map is created
+ gdouble longitude; // only used when the center_on is called before map is created
+ gdouble latitude; // only used when the center_on is called before map is created
ClutterActor *map_layer;
ClutterActor *viewport;
resize_viewport(ChamplainView *view)
{
gdouble lower, upper;
+ gboolean center = FALSE;
TidyAdjustment *hadjust, *vadjust;
ChamplainViewPrivate *priv = CHAMPLAIN_VIEW_GET_PRIVATE (view);
if(!priv->map)
{
create_initial_map(view);
+ center = TRUE;
}
clutter_actor_set_size (priv->finger_scroll, priv->viewport_size.width, priv->viewport_size.height);
}
g_object_set (vadjust, "lower", lower, "upper", upper,
"step-increment", 1.0, "elastic", TRUE, NULL);
+
+ if (center)
+ {
+ champlain_view_center_on(view, priv->longitude, priv->latitude);
+ marker_reposition(view);
+ }
}
static void
if(!priv->map)
{
- create_initial_map(view);
+ // keep until the viewport is created
+ priv->longitude = longitude;
+ priv->latitude = latitude;
+ return;
}
gdouble x, y;