#include <gtk/gtk.h>
#include <math.h>
+#include "viking.h"
#include "coords.h"
#include "vikcoord.h"
#include "mapcoord.h"
-#include "http.h"
+#include "download.h"
+#include "vikmapslayer.h"
#include "googlemaps.h"
+static DownloadOptions googlemaps_options = { 1, "http://maps.google.com/" };
+
+/* initialisation */
+void googlemaps_init () {
+ VikMapsLayer_MapType map_type = { 9, 128, 128, VIK_VIEWPORT_DRAWMODE_GOOGLE, googlemaps_coord_to_mapcoord, googlemaps_mapcoord_to_center_coord, googlemaps_download };
+ maps_layer_register_type("Old Google Maps", 9, &map_type);
+}
+
/* 1 << (x-1) is like a 2**(x-1) */
#define GZ(x) ((1<<(x-1))*GOOGLEMAPS_ZOOM_ONE_MPP)
void googlemaps_download ( MapCoord *src, const gchar *dest_fn )
{
- gchar *uri = g_strdup_printf ( "/mt?v=.3&x=%d&y=%d&zoom=%d", src->x, src->y, src->scale );
- a_http_download_get_url ( "mt.google.com", uri, dest_fn );
+ gchar *uri = g_strdup_printf ( "/mt?&x=%d&y=%d&zoom=%d", src->x, src->y, src->scale );
+ a_http_download_get_url ( "mt.google.com", uri, dest_fn, &googlemaps_options );
g_free ( uri );
}