This is a patch for maemo-mapper 0.1.  It adds support for using satellite
images from Google Maps or any equivalent service.

To use Google Maps, specify the following URI prefix:
http://kh.google.com/kh?n=404&v=6&t=%s

diff -up ./maemo-mapper.c.orig ./maemo-mapper.c
--- ./maemo-mapper.c.orig	2006-05-13 21:07:18.000000000 +0300
+++ ./maemo-mapper.c	2006-05-13 21:07:22.000000000 +0300
@@ -2161,6 +2161,37 @@ progress_update_info_free(ProgressUpdate
     vprintf("%s(): return\n", __PRETTY_FUNCTION__);
 }
 
+static void
+map_convert_coords_to_quadtree_string(int x, int y, int zoomlevel, char * buffer)
+{
+    char * quadrant = "qrts";
+    char * ptr = buffer;
+    int n;
+    *ptr++ = 't';
+    for (n = 16-zoomlevel; n >= 0; n--)
+    {
+        int xbit = (x >> n) & 1;
+        int ybit = (y >> n) & 1;
+        *ptr++ = quadrant[xbit + 2 * ybit];
+    }
+    *ptr++ = '\0';
+}
+
+static void
+map_construct_url(gchar *buffer, guint tilex, guint tiley, guint zoom)
+{
+    if (strstr(_map_uri_format, "%s"))
+    {
+        char location[MAX_ZOOM + 2];
+        map_convert_coords_to_quadtree_string(tilex, tiley, zoom - 1, location);
+        sprintf(buffer, _map_uri_format, location);
+    }
+    else
+    {
+        sprintf(buffer, _map_uri_format, tilex, tiley, zoom - 1);
+    }
+}
+
 static gboolean
 map_initiate_download(gchar *buffer, guint tilex, guint tiley, guint zoom)
 {
@@ -2199,7 +2230,7 @@ map_initiate_download(gchar *buffer, gui
                 + abs(tile2punit(tiley, zoom) - _center.unity));
     BOUND(priority, GNOME_VFS_PRIORITY_MIN, GNOME_VFS_PRIORITY_MAX);
 
-    sprintf(buffer, _map_uri_format, tilex, tiley, zoom - 1);
+    map_construct_url(buffer, tilex, tiley, zoom);
     src = gnome_vfs_uri_new(buffer);
     src_list = g_list_prepend(src_list, src);
     dest_list = g_list_prepend(dest_list, dest);

