]> git.street.me.uk Git - andy/viking.git/blobdiff - src/datasource_google.c
Use elevation values in creating waypoints from Wikipedia.
[andy/viking.git] / src / datasource_google.c
index 7cafd3300a30132e8052f72af4d5b2d6080583f7..c2b33a5e64419ebcfc9318e23b28bc739c7b8225 100644 (file)
@@ -31,7 +31,7 @@
 #include "gpx.h"
 #include "acquire.h"
 
-#define GOOGLE_DIRECTIONS_STRING "maps.google.com/maps?q=from:%s+to:%s&output=kml"
+#define GOOGLE_DIRECTIONS_STRING "maps.google.com/maps?q=from:%s+to:%s&output=js"
 
 typedef struct {
   GtkWidget *from_entry, *to_entry;
@@ -42,20 +42,22 @@ static gchar *last_to_str = NULL;
 
 static gpointer datasource_google_init( );
 static void datasource_google_add_setup_widgets ( GtkWidget *dialog, VikViewport *vvp, gpointer user_data );
-static void datasource_google_get_cmd_string ( datasource_google_widgets_t *widgets, gchar **cmd, gchar **input_file_type );   
+static void datasource_google_get_cmd_string ( datasource_google_widgets_t *widgets, gchar **cmd, gchar **input_file_type, DownloadMapOptions *options );
 static void datasource_google_cleanup ( gpointer data );
 
 VikDataSourceInterface vik_datasource_google_interface = {
   N_("Google Directions"),
   N_("Google Directions"),
-  VIK_DATASOURCE_URL,
   VIK_DATASOURCE_ADDTOLAYER,
   VIK_DATASOURCE_INPUTTYPE_NONE,
   TRUE,
+  TRUE,
+  TRUE,
   (VikDataSourceInitFunc)              datasource_google_init,
   (VikDataSourceCheckExistenceFunc)    NULL,
   (VikDataSourceAddSetupWidgetsFunc)   datasource_google_add_setup_widgets,
   (VikDataSourceGetCmdStringFunc)      datasource_google_get_cmd_string,
+  (VikDataSourceProcessFunc)            a_babel_convert_from_url,
   (VikDataSourceProgressFunc)          NULL,
   (VikDataSourceAddProgressWidgetsFunc)        NULL,
   (VikDataSourceCleanupFunc)           datasource_google_cleanup,
@@ -87,7 +89,7 @@ static void datasource_google_add_setup_widgets ( GtkWidget *dialog, VikViewport
   gtk_widget_show_all(dialog);
 }
 
-static void datasource_google_get_cmd_string ( datasource_google_widgets_t *widgets, gchar **cmd, gchar **input_file_type )
+static void datasource_google_get_cmd_string ( datasource_google_widgets_t *widgets, gchar **cmd, gchar **input_file_type, DownloadMapOptions *options )
 {
   /* TODO: special characters handling!!! */
   gchar *from_quoted, *to_quoted;
@@ -101,7 +103,8 @@ static void datasource_google_get_cmd_string ( datasource_google_widgets_t *widg
   to_quoted = g_strjoinv( "%20", to_split);
 
   *cmd = g_strdup_printf( GOOGLE_DIRECTIONS_STRING, from_quoted, to_quoted );
-  *input_file_type = g_strdup("kml");
+  *input_file_type = g_strdup("google");
+  options = NULL;
 
   g_free(last_from_str);
   g_free(last_to_str);