Is it Hard to Use?

Not really. Look at the following example. With this code you get a fully functional application with the map widget covering the whole window. You can zoom in and out with your mouse wheel and scroll the view by dragging it. The tiles are downloaded automatically from the network and cached on your disk so they will be available next time even if you are offline.

Notice that only two lines of the code below are specific to libchamplain - the include header and then the call of the constructor of the widget - the rest is just the ordinary boilerplate code you would write for any clutter-based application.

#include <gtk/gtk.h> /* include the libchamplain header */ #include <champlain-gtk/champlain-gtk.h> #include <clutter-gtk/clutter-gtk.h> int main (int argc, char *argv[]) { GtkWidget *window, *widget; /* initialize threads and clutter */ g_thread_init (NULL); gtk_clutter_init (&argc, &argv); /* create the top-level window and quit the main loop when it's closed */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL); /* create the libchamplain widget and set its size */ widget = gtk_champlain_embed_new (); gtk_widget_set_size_request (widget, 640, 480); /* insert it into the widget you wish */ gtk_container_add (GTK_CONTAINER (window), widget); /* show everything */ gtk_widget_show_all (window); /* start the main loop */ gtk_main (); return 0; }

If you save the above code to a file, say champlain.c, you can compile the application (after installing libchamplain first of course) by running:

gcc -o champlain champlain.c `pkg-config --cflags --libs champlain-gtk-0.12`

Now you probably want to do some more advanced things and customize the widget to your needs. Check the demos in the demos directory of the source distribution and read the reference manual to explore the full capabilities of the widget.

Read the Manual Online

Latest Stable Release

libchamplain 0.12

libchamplain-gtk 0.12

Unstable release

libchamplain

libchamplain-gtk