[empathy] Add marker on map
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Subject: [empathy] Add marker on map
- Date: Wed, 27 May 2009 12:55:01 -0400 (EDT)
commit 1ad83ec843cb36808310afb5fe9e5ea296d3f0fb
Author: Pierre-Luc Beaudoin <pierre-luc pierlux com>
Date: Tue Dec 16 17:41:40 2008 -0500
Add marker on map
---
libempathy-gtk/empathy-contact-widget.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index faa6b1b..90fb7ba 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -1239,6 +1239,8 @@ contact_widget_location_update (EmpathyContactWidget *information)
GHashTable *location = empathy_contact_get_location (information->contact);
GValue *value;
gdouble lat, lon;
+ ClutterActor *marker;
+ ChamplainLayer *layer;
value = g_hash_table_lookup (location, EMPATHY_LOCATION_LAT);
if (value == NULL)
@@ -1292,6 +1294,14 @@ contact_widget_location_update (EmpathyContactWidget *information)
g_object_set (G_OBJECT (information->map_view), "show-license", FALSE,
NULL);
+ layer = champlain_layer_new ();
+ champlain_view_add_layer (CHAMPLAIN_VIEW (information->map_view), layer);
+
+ marker = champlain_marker_new_with_label (
+ empathy_contact_get_name (information->contact), NULL, NULL, NULL);
+ champlain_marker_set_position (CHAMPLAIN_MARKER (marker), lat, lon);
+ clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
+
champlain_view_center_on (CHAMPLAIN_VIEW(information->map_view), lat, lon);
gtk_widget_show_all (information->vbox_location);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]