From: Pierre-Luc Beaudoin Date: Tue, 16 Sep 2008 15:06:14 +0000 (-0400) Subject: Use (lat, lon) instead of (lon, lat) X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46b99dfa2bb68987eedc6a15e1aca8850feb5af0;p=libchamplain Use (lat, lon) instead of (lon, lat) --- diff --git a/champlain/champlainview.c b/champlain/champlainview.c index 414195f..05e45ff 100644 --- a/champlain/champlainview.c +++ b/champlain/champlainview.c @@ -162,7 +162,7 @@ scroll_event (ClutterActor *actor, ClutterScrollEvent *event, ChamplainView *vie resize_viewport(view); clutter_container_remove_actor (CLUTTER_CONTAINER (priv->map_layer), group); clutter_container_add_actor (CLUTTER_CONTAINER (priv->map_layer), priv->map->current_level->group); - champlain_view_center_on(view, lon2, lat2); + champlain_view_center_on(view, lat2, lon2); g_object_notify(G_OBJECT(view), "zoom-level"); } @@ -288,7 +288,7 @@ resize_viewport(ChamplainView *view) if (center) { - champlain_view_center_on(view, priv->longitude, priv->latitude); + champlain_view_center_on(view, priv->latitude, priv->longitude); } } @@ -348,14 +348,14 @@ champlain_view_set_property(GObject *object, guint prop_id, const GValue *value, { gdouble lon = g_value_get_double(value); gdouble lat = viewport_get_current_latitude(priv); - champlain_view_center_on(view, lon, lat); + champlain_view_center_on(view, lat, lon); break; } case PROP_LATITUDE: { gdouble lon = viewport_get_current_longitude(priv); gdouble lat = g_value_get_double(value); - champlain_view_center_on(view, lon, lat); + champlain_view_center_on(view, lat, lon); break; } case PROP_ZOOM_LEVEL: @@ -366,14 +366,14 @@ champlain_view_set_property(GObject *object, guint prop_id, const GValue *value, if (level != priv->map->current_level->level) { ClutterActor *group = priv->map->current_level->group; - gdouble lon = viewport_get_current_longitude(priv); gdouble lat = viewport_get_current_latitude(priv); + gdouble lon = viewport_get_current_longitude(priv); if (map_zoom_to(priv->map, level)) { resize_viewport(view); clutter_container_remove_actor (CLUTTER_CONTAINER (priv->map_layer), group); clutter_container_add_actor (CLUTTER_CONTAINER (priv->map_layer), priv->map->current_level->group); - champlain_view_center_on(view, lon, lat); + champlain_view_center_on(view, lat, lon); } } } @@ -654,8 +654,8 @@ champlain_view_new (ChamplainViewMode mode) /** * champlain_view_center_on: * @view: a #ChamplainView - * @longitude: the longitude to center the map at * @latitude: the longitude to center the map at + * @longitude: the longitude to center the map at * * Centers the map on these coordinates. * @@ -663,7 +663,7 @@ champlain_view_new (ChamplainViewMode mode) */ // FIXME: Animate this. Can be done in Tidy-Adjustment (like for elastic effect) void -champlain_view_center_on (ChamplainView *view, gdouble longitude, gdouble latitude) +champlain_view_center_on (ChamplainView *view, gdouble latitude, gdouble longitude) { ChamplainViewPrivate *priv = CHAMPLAIN_VIEW_GET_PRIVATE (view); @@ -743,7 +743,7 @@ champlain_view_zoom_in (ChamplainView *view) resize_viewport(view); clutter_container_remove_actor (CLUTTER_CONTAINER (priv->map_layer), group); clutter_container_add_actor (CLUTTER_CONTAINER (priv->map_layer), priv->map->current_level->group); - champlain_view_center_on(view, lon, lat); + champlain_view_center_on(view, lat, lon); g_object_notify(G_OBJECT(view), "zoom-level"); } @@ -770,7 +770,7 @@ champlain_view_zoom_out (ChamplainView *view) resize_viewport(view); clutter_container_remove_actor (CLUTTER_CONTAINER (priv->map_layer), group); clutter_container_add_actor (CLUTTER_CONTAINER (priv->map_layer), priv->map->current_level->group); - champlain_view_center_on(view, lon, lat); + champlain_view_center_on(view, lat, lon); g_object_notify(G_OBJECT(view), "zoom-level"); } @@ -795,7 +795,7 @@ champlain_view_add_layer (ChamplainView *view, ClutterActor *layer) if(priv->map) marker_reposition(view); - g_signal_connect (layer, + g_signal_connect_after (layer, "add", G_CALLBACK (layer_add_marker_cb), view); diff --git a/champlain/champlainview.h b/champlain/champlainview.h index 9fd1de0..ee64b7a 100644 --- a/champlain/champlainview.h +++ b/champlain/champlainview.h @@ -81,7 +81,7 @@ GType champlain_view_get_type (void); ClutterActor *champlain_view_new (ChamplainViewMode mode); -void champlain_view_center_on (ChamplainView *view, gdouble longitude, gdouble latitude); +void champlain_view_center_on (ChamplainView *view, gdouble latitude, gdouble longitude); void champlain_view_zoom_in (ChamplainView *champlainView); diff --git a/champlain/launcher.c b/champlain/launcher.c index 8bbd21a..2b6a346 100644 --- a/champlain/launcher.c +++ b/champlain/launcher.c @@ -31,15 +31,15 @@ create_marker_layer () ClutterColor orange = { 0xf3, 0x94, 0x07, 0xbb }; ClutterColor white = { 0xff, 0xff, 0xff, 0xff }; marker = champlain_marker_new_with_label("Montréal", "Airmole 14", NULL, NULL); - champlain_marker_set_position(CHAMPLAIN_MARKER(marker), -73.563788, 45.528178); + champlain_marker_set_position(CHAMPLAIN_MARKER(marker), 45.528178, -73.563788); clutter_container_add(CLUTTER_CONTAINER(layer), marker, NULL); marker = champlain_marker_new_with_label("New York", "Sans 25", &white, NULL); - champlain_marker_set_position(CHAMPLAIN_MARKER(marker), -73.98, 40.77); + champlain_marker_set_position(CHAMPLAIN_MARKER(marker), 40.77, -73.98); clutter_container_add(CLUTTER_CONTAINER(layer), marker, NULL); marker = champlain_marker_new_with_label("Saint-Tite-des-Caps", "Serif 12", NULL, &orange); - champlain_marker_set_position(CHAMPLAIN_MARKER(marker), -70.764141, 47.130885); + champlain_marker_set_position(CHAMPLAIN_MARKER(marker), 47.130885, -70.764141); clutter_container_add(CLUTTER_CONTAINER(layer), marker, NULL); clutter_actor_hide(layer); @@ -66,7 +66,7 @@ main (int argc, char *argv[]) champlain_view_add_layer(actor, layer); clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); - champlain_view_center_on(CHAMPLAIN_VIEW(actor), -73.75, 45.466); + champlain_view_center_on(CHAMPLAIN_VIEW(actor), 45.466, -73.75); clutter_actor_show (stage); clutter_main ();