]> git.itanic.dy.fi Git - maemo-mapper/commitdiff
Added support for maps that behave like Yahoo Maps (signed Y tile
authorgnuite <gnuite@gmail.com>
Sun, 9 Mar 2008 20:17:53 +0000 (20:17 +0000)
committergnuite <gnuite@gmail.com>
Sun, 9 Mar 2008 20:17:53 +0000 (20:17 +0000)
numbers).

git-svn-id: svn+ssh://garage/var/lib/gforge/svnroot/maemo-mapper/trunk@157 6c538b50-5814-0410-93ad-8bdf4c0149d1

src/maps.c
src/types.h

index 177ff8c1dbd01e956fa1787d6b813cb22eb61870..9ec45c87956716471041092869b85a269bf21fb3 100644 (file)
@@ -898,6 +898,8 @@ set_repo_type(RepoData *repo)
             repo->type = REPOTYPE_QUAD_QRST;
         else if(strstr(url, "%0d"))
             repo->type = REPOTYPE_XYZ_INV;
+        else if(strstr(url, "%-d"))
+            repo->type = REPOTYPE_XYZ_SIGNED;
         else if(strstr(url, "%0s"))
             repo->type = REPOTYPE_QUAD_ZERO;
         else
@@ -1231,7 +1233,8 @@ static gchar*
 map_construct_url(RepoData *repo, gint zoom, gint tilex, gint tiley)
 {
     gchar *retval;
-    vprintf("%s()\n", __PRETTY_FUNCTION__);
+    vprintf("%s(%p, %d, %d, %d)\n", __PRETTY_FUNCTION__,
+            repo, zoom, tilex, tiley);
     switch(repo->type)
     {
         case REPOTYPE_XYZ:
@@ -1244,6 +1247,13 @@ map_construct_url(RepoData *repo, gint zoom, gint tilex, gint tiley)
                     MAX_ZOOM + 1 - zoom, tilex, tiley);
             break;
 
+        case REPOTYPE_XYZ_SIGNED:
+            retval = g_strdup_printf(repo->url,
+                    tilex,
+                    (1 << (MAX_ZOOM - zoom)) - tiley - 1,
+                    zoom - (MAX_ZOOM - 17));
+            break;
+
         case REPOTYPE_QUAD_QRST:
         {
             gchar location[MAX_ZOOM + 2];
index 70ae7e1b6bad745d10a4a2772283d4e3884cfeec..23cd27ea2c156ccac140f07c7e95f6be1f521938 100644 (file)
@@ -63,6 +63,7 @@ typedef enum
 {
     REPOTYPE_NONE, /* No URL set. */
     REPOTYPE_XYZ, /* x=%d, y=%d, and zoom=%d */
+    REPOTYPE_XYZ_SIGNED, /* x=%d, y=%d, and zoom=%d-2 */
     REPOTYPE_XYZ_INV, /* zoom=%0d, x=%d, y=%d */
     REPOTYPE_QUAD_QRST, /* t=%s   (%s = {qrst}*) */
     REPOTYPE_QUAD_ZERO, /* t=%0s  (%0s = {0123}*) */