+
+static int
+_download ( VikMapSource *self, MapCoord *src, const gchar *dest_fn, void *handle )
+{
+ int res;
+ gchar *uri = vik_map_source_default_get_uri(VIK_MAP_SOURCE_DEFAULT(self), src);
+ gchar *host = vik_map_source_default_get_hostname(VIK_MAP_SOURCE_DEFAULT(self));
+ DownloadMapOptions *options = vik_map_source_default_get_download_options(VIK_MAP_SOURCE_DEFAULT(self));
+ res = a_http_download_get_url ( host, uri, dest_fn, options, handle );
+ g_free ( uri );
+ g_free ( host );
+ return res;
+}
+
+static void *
+_download_handle_init ( VikMapSource *self )
+{
+ return a_download_handle_init ();
+}
+
+
+static void
+_download_handle_cleanup ( VikMapSource *self, void *handle )
+{
+ a_download_handle_cleanup ( handle );
+}
+
+gchar *
+vik_map_source_default_get_uri( VikMapSourceDefault *self, MapCoord *src )
+{
+ VikMapSourceDefaultClass *klass;
+ g_return_val_if_fail (self != NULL, 0);
+ g_return_val_if_fail (VIK_IS_MAP_SOURCE_DEFAULT (self), 0);
+ klass = VIK_MAP_SOURCE_DEFAULT_GET_CLASS(self);
+
+ g_return_val_if_fail (klass->get_uri != NULL, 0);
+
+ return (*klass->get_uri)(self, src);
+}
+
+gchar *
+vik_map_source_default_get_hostname( VikMapSourceDefault *self )
+{
+ VikMapSourceDefaultClass *klass;
+ g_return_val_if_fail (self != NULL, 0);
+ g_return_val_if_fail (VIK_IS_MAP_SOURCE_DEFAULT (self), 0);
+ klass = VIK_MAP_SOURCE_DEFAULT_GET_CLASS(self);
+
+ g_return_val_if_fail (klass->get_hostname != NULL, 0);
+
+ return (*klass->get_hostname)(self);
+}
+
+DownloadMapOptions *
+vik_map_source_default_get_download_options( VikMapSourceDefault *self )
+{
+ VikMapSourceDefaultClass *klass;
+ g_return_val_if_fail (self != NULL, 0);
+ g_return_val_if_fail (VIK_IS_MAP_SOURCE_DEFAULT (self), 0);
+ klass = VIK_MAP_SOURCE_DEFAULT_GET_CLASS(self);
+
+ g_return_val_if_fail (klass->get_download_options != NULL, 0);
+
+ return (*klass->get_download_options)(self);
+}