| Subcribe via RSS

Interesting product, but…

November 27th, 2008 | 1 Comment | Posted in Gnome, Technologie, libchamplain

So Nikon has a geotagger in its sleeves and it is soon to be available.  Unfortunately it won’t be compatible with my D40.  Reading the review and the technical specifications, I am not so sorry.

The device seems small, fast and it doesn’t required its own power source.  That’s the pros.  The con is that you need to use a software to geotag your pictures afterwards.  I mean: come on, you can easily put that directly into the EXIF data right at the moment your are taking the picture!  No need to do that afterwards!

So while this is a very interesting products, we’ll have to wait a bit more to have something that just works and isn’t a more work.

On a side note, this means that my EOG Map plug-in will be much more useful in the next years!

Designing libchamplain 0.4

November 24th, 2008 | No Comments | Posted in Gnome, Technologie, libchamplain

As more and more people are using and asking for features in libchamplain, I face a difficult challenge getting the current design to do new extraordinary things.

Here are the top features that can (or can’t) only be hacked into the current design:

  1. To be able to replace the Clutter front end;
  2. To have a global state for the library (ie. loading or done);
  3. To have the tiles rendered on demand;
  4. To have our own map sources;
  5. To have a smooth animation when recentering the map;
  6. To have a zoom in/out animation.

The first feature is really the one that calls for a new architecture.  The current design relays heavily on Clutter, even for internal data representation.  This breaks the golden MVC rule and it is my first goal in this redesign.

Having the tile loading code interweaved with the model really makes it more ugly to have feature #2 and #3.  With a controler actually building the model, the tiles could come from elsewhere without making the model much more complex and the loading code can be placed together resulting in less places where the states change.

And finaly, since the view is also the controler which modifies the model, having the animations code inside the view makes some animations tricky.

While at it, why not take into account some special requirements, such a non blocking calls.  Clicking on the zoom in button should call the zoom in function, which should return as fast as possible not to block the UI.

First design steps

First I thought about the visibility of each objects.  Since I want minimal impact on the current API, I will keep the View as the main interaction point between an application and libchamplain.  To fulfill feature #4, a ChamplainMapSource interface will be created.  This is how it works internally right now, but instead of an interface, there is a struct of function pointers.

The whole data model will be available to an application wishing to implement its own map source. It will have helper controler classes such as a map loader, and eventually a map renderer.

The view should be sending the user’s actions to the main controler, which will be called ChamplainEngine.  This engine will be in charge of keeping the global settings, state and a reference to the model.  When the model changes, the view will be informe through different signals and notifications on properties’ changes.

Trying the design on paper

So I went on use this very good online sequence diagram generator to define precisely who will be responsible for instanciating objects, notifying the view and loading stuff.  I tried to stick to this rule: all model changes should happen from ChamplainEngine.

So here some of the diagrams I created.

Those diagrams enabled me to test the task division and define very precisely how the view will get informed of the model’s changes.  Implementing this design should now be very fast, granted I don’t run into unattended issues!

libchamplain 0.2.7

November 16th, 2008 | No Comments | Posted in Gnome, OpenStreetMap, Technologie, libchamplain

I am announcing the release of libchamplain 0.2.7. Libchamplain is a ClutterActor to display maps.  Libchamplain-gtk is a Gtk+ widget wrapping it.

This is a screenshot of the demo launcher displaying OpenStreetMap data for Helsinki (Finland).

This is a screenshot of the demo launcher displaying OpenStreetMap data for Helsinki (Finland).


Enhancements:

  • Double clicking on the map will now zoom and recenter.
  • When resizing a ChamplainView, the centered content will still be centered after the resizing.  Can be disabled.
  • The Map’s license is displayed by default on the lower right corner. Can be hidden.

Fixes:

  • Fix a memory leak
  • Some code clean-up
  • Fix Bug 558026 – zoom in + center_on != center_on + zoom in
  • Fix missing zoom level in OpenStreetMap Mapnik

libchamplain-gtk has been version bumped to 0.2.7 - no changes since 0.2.6.

This should be the last release of the 0.2 series.  I plan to rewrite part of the internals to better follow the MVC principle, which will improve the code’s readability and allow for more complex features to be introducted in the future.

More info on the project page.

EOG Champlain plugin is now merged

October 12th, 2008 | No Comments | Posted in Gnome, Technologie, libchamplain

The code to display maps in EOG for you geotagged photos is now merged into EOG Plugins.

You can grabe the code there:

svn co http://svn.gnome.org/svn/eog-plugins/trunk eog-plugin

To build it, you will need libchamplain and libchamplain 0.2.2 or later.

You can find 2 sample geotagged images on the bugzilla.

Libchamplain 0.2.2

October 7th, 2008 | No Comments | Posted in Gnome, Technologie, libchamplain

In this release of your favorite Gtk+ Map Widget you get:

  • Bug fixes:
    • zoom-level property changes are notified if changed when setting a new map-source;
    • Markers are now ordered from top to bottom instead of first added, first drawn using ChamplainLayer.  This is more natural to the eye.
  • Less exported symbols;
  • A less error prone library (data passed as parameter is now validated); — thanks to Marco for pointing out my Engrish lol

Grab the 0.2.2 release here!

Since I forgot to blog abour libchamplain 0.2.1, here is what was improved:

  • Bug fixes:
    • Markers’ position wasn’t updated when the map was recentered;
    • Build fixes for packagers;
  • A more standard API: (lat, lon) is now used instead of (lon, lat);
  • There is now libchamplain and libchamplain-gtk.  libchamplain can be used alone in a pure Clutter applications, where libchamplain-gtk is obviously a Gtk+ widget that wraps libchamplain.

EOG Map Plugin is now public

With this release, I am also happy to announce that I have published the code for the EOG Map plugin. You can grab it here in the Gnome Buzilla.  Download it, try it and test it, there has to be some bugs left over hehe (although I did my best to polish it!).

I see progress

September 8th, 2008 | 2 Comments | Posted in Gnome, Technologie, libchamplain

I’ve been very busy in the last 2 weeks (with my brother’s emergency surgery and the work), but I did manage to work on libchamplain and code new features.

I finally fixed the limited zoom bug I had (it did take me more than one try!). There were some glitches with small zoom levels (where the map was smaller than the window), but these are history.  I also had to patch clutter-gtk (see bug #1114) to generate [the missing] scroll events to have mouse wheel zooming.

Different map sources are now available. You currently have 3 sources built-in: OpenStreetMap Mapnik, OpenArialMap and Maps For Free Relief.  You can change the map source at run time!  I’ve attempted to write support for other non free sources but their usage terms prevents their use, so I stopped.

Markers (pins on the map) were planned for 0.3, but I figured they were so important that I wrote them earlier. ChamplainMarkers are nothing more than ClutterActors placed at the right position on the map. You are free to draw anything (or load an image) as a marker. I also created a default marker for simple text markers. In the first screenshot, all markers are different because I wanted to demonstrate the parameters you can change (text, font, marker color and font color).  Markers can even be translucient!

Little fixes to the installed files, small animations and complete doc are also in. I think it is now usable in a real-life application. That is why I wrote EOG Map plugin (a very good idea of vuntz).

It is is a plugin for Eye of Gnome that adds a sidebar that displays the geolocation of the image on a map. I even toyed with the champlain API and created an annoying but yet cool throbbing marker.

I’d like to thank the people who helped me put this together. Their early reviews, comments and their help were key to keep me progressing when I was actually growing out gray hair on problems (like getting gtk-doc working).

Now, could your app benefit from a map? Think about it :)  In the mean time, someone wants to package it?

Introducing libchamplain

August 22nd, 2008 | 2 Comments | Posted in Gnome, Technologie, libchamplain

I was planning to announce this on Monday, after a week-end to clean things up, but since another widget with similar features have been announced today, I think I should announce mine as well!

So libchamplain is a Gtk+ widget that aims to display rasterized maps (OpenStreetMap, Google Maps and others) using Clutter to have nice animations.  It is in a workable state (only zooming is limited for now, and that’s what I was planning to iron out this week-end).  See the web site for detailed feature and planned features.

You can grab the LGPLed code on gitorious.  Comments, reviews and patches/branches are welcome :)

Update: I created a screencast to demo it, but we can’t really see the nice animations here.  How do we do a nice screencast of a Clutter based app?

Update: I pushed the missing marshal file, thanks bpeel.