X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/50a14534a51f892500ee82f867e8ab2f85b936ae..ecb510183ad77bf7ce7b3a4e2a25ed3364e928ed:/src/google.c diff --git a/src/google.c b/src/google.c index 50ecfa91..22210102 100644 --- a/src/google.c +++ b/src/google.c @@ -28,6 +28,21 @@ #include "http.h" #include "globals.h" #include "google.h" +#include "vikmapslayer.h" + +#define GOOGLE_VERSION "w2.37" +#define GOOGLE_TRANS_VERSION "w2t.38" +#define GOOGLE_KH_VERSION "14" + +void google_init () { + VikMapsLayer_MapType google_1 = { 7, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, google_coord_to_mapcoord, google_mapcoord_to_center_coord, google_download }; + VikMapsLayer_MapType google_2 = { 10, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, google_coord_to_mapcoord, google_mapcoord_to_center_coord, google_trans_download }; + VikMapsLayer_MapType google_3 = { 11, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, google_coord_to_mapcoord, google_mapcoord_to_center_coord, google_kh_download }; + + maps_layer_register_type("Google Maps", 7, &google_1); + maps_layer_register_type("Transparent Google Maps", 10, &google_2); + maps_layer_register_type("Google Satellite Images", 11, &google_3); +} /* 1 << (x) is like a 2**(x) */ #define GZ(x) ((1<x, src->y, src->scale ); - gchar *uri = g_strdup_printf ( "/kh?v=3&t=%s", khenc ); + gchar *uri = g_strdup_printf ( "/kh?v=%s&t=%s", GOOGLE_KH_VERSION, khenc ); g_free ( khenc ); a_http_download_get_url ( "kh.google.com", uri, dest_fn ); g_free ( uri );