]> git.street.me.uk Git - andy/viking.git/blobdiff - src/expedia.c
Add option to download only maps that are more recent on server
[andy/viking.git] / src / expedia.c
index e7a4169994c309f97f21dd40e868802cb9281f48..9b996658af0236c129be4eae2027acfe638e137a 100644 (file)
 
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
+#ifdef HAVE_MATH_H
 #include <math.h>
+#endif
+
 #include "globals.h"
 #include "coords.h"
 #include "vikcoord.h"
@@ -41,10 +44,10 @@ static gboolean expedia_coord_to_mapcoord ( const VikCoord *src, gdouble xzoom,
 static void expedia_mapcoord_to_center_coord ( MapCoord *src, VikCoord *dest );
 static int expedia_download ( MapCoord *src, const gchar *dest_fn );
 
-static DownloadOptions expedia_options = { NULL, 2 };
+static DownloadOptions expedia_options = { FALSE, NULL, 2, a_check_map_file };
 
 void expedia_init() {
-  VikMapsLayer_MapType map_type = { 5, 0, 0, VIK_VIEWPORT_DRAWMODE_EXPEDIA, expedia_coord_to_mapcoord, expedia_mapcoord_to_center_coord, expedia_download };
+  VikMapsLayer_MapType map_type = { 5, 0, 0, VIK_VIEWPORT_DRAWMODE_EXPEDIA, expedia_coord_to_mapcoord, expedia_mapcoord_to_center_coord, expedia_download, &expedia_options };
   maps_layer_register_type(_("Expedia Street Maps"), 5, &map_type);
 }
 
@@ -184,6 +187,7 @@ static int expedia_download ( MapCoord *src, const gchar *dest_fn )
 
   if ((res = a_http_download_get_url ( EXPEDIA_SITE, uri, dest_fn, &expedia_options )) == 0)   /* All OK */
        expedia_snip ( dest_fn );
+  g_free(uri);
   return(res);
 }