[OSM-talk] Annouce : Planet incremental search

Dave Hansen dave at sr71.net
Sat Jun 16 19:02:48 BST 2007


I added a quick hack to make this zoom JOSM-style:

gint Scroll (GtkWidget *widget, GdkEventScroll *event, void *w_current)
{
        switch (event->direction) {
        case(GDK_SCROLL_UP):
                zoom = zoom*3/4;
                break;
        case(GDK_SCROLL_DOWN):
                zoom = zoom*4/3;
                break;
        }
        gtk_widget_queue_clear (draw);
}
...
        gtk_signal_connect (GTK_OBJECT (draw), "scroll_event",
                        (GtkSignalFunc) Scroll, NULL);

I remembered doing this that JOSM's zoom-in doesn't zoom onto the middle
of the screen, but it also doesn't recenter on the mouse.  It appears to
zoom so that whatever you were zooming in on stays _under_ the mouse.
That took a lot more than the 10 lines of code above, so I decided to
skip it for now.

I tried to get gosmore to render a few .osm files that I've been
generating from TIGER data, but gosmore's XML parser needs few more
features, like not requiring that all nodes come before all segments
which come before all ways.

I tried to fix this, but the 10 levels of indenting in the main file
loop gave me a bit of a headache. :)

Any chance you have that on your todo list?

-- Dave





More information about the talk mailing list