]> err.no Git - libchamplain/commitdiff
Use (lat, lon) instead of (lon, lat)
authorPierre-Luc Beaudoin <pierre-luc@squidy.info>
Tue, 16 Sep 2008 15:06:14 +0000 (11:06 -0400)
committerPierre-Luc Beaudoin <pierre-luc@squidy.info>
Tue, 16 Sep 2008 15:06:14 +0000 (11:06 -0400)
champlain/champlainview.c
champlain/champlainview.h
champlain/launcher.c

index 414195f8d10e79e74342e63ab107346bfec5040e..05e45ff68156868b39abf0e3c936a83dbfdc31ca 100644 (file)
@@ -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);
index 9fd1de043091acb3c118f29ff71779dc1f646b69..ee64b7abdffc7739cb72ebe0105a5e951a44a53c 100644 (file)
@@ -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);
 
index 8bbd21abc711076c23f8ae195bc213f1fdf31432..2b6a3461901f9c7726dc4d8e4c78505bc8afaafb 100644 (file)
@@ -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 ();