]> git.street.me.uk Git - andy/viking.git/blobdiff - src/datasource_google.c
[MAPS] Add OpenSeaMap source
[andy/viking.git] / src / datasource_google.c
index 11c567dc0e49c23e39c2ec5d21b437d010a2af9a..10d4991a73ce7fa7831866a7ab8dd95ef8371713 100644 (file)
@@ -31,7 +31,7 @@
 #include "gpx.h"
 #include "acquire.h"
 
 #include "gpx.h"
 #include "acquire.h"
 
-#define GOOGLE_DIRECTIONS_STRING "maps.google.com/maps?q=from:%s+to:%s&output=js"
+#define GOOGLE_DIRECTIONS_STRING "maps.google.com/maps?q=from:%s+to:%s&output=kml"
 
 typedef struct {
   GtkWidget *from_entry, *to_entry;
 
 typedef struct {
   GtkWidget *from_entry, *to_entry;
@@ -52,13 +52,16 @@ VikDataSourceInterface vik_datasource_google_interface = {
   VIK_DATASOURCE_ADDTOLAYER,
   VIK_DATASOURCE_INPUTTYPE_NONE,
   TRUE,
   VIK_DATASOURCE_ADDTOLAYER,
   VIK_DATASOURCE_INPUTTYPE_NONE,
   TRUE,
+  TRUE,
   (VikDataSourceInitFunc)              datasource_google_init,
   (VikDataSourceCheckExistenceFunc)    NULL,
   (VikDataSourceAddSetupWidgetsFunc)   datasource_google_add_setup_widgets,
   (VikDataSourceGetCmdStringFunc)      datasource_google_get_cmd_string,
   (VikDataSourceInitFunc)              datasource_google_init,
   (VikDataSourceCheckExistenceFunc)    NULL,
   (VikDataSourceAddSetupWidgetsFunc)   datasource_google_add_setup_widgets,
   (VikDataSourceGetCmdStringFunc)      datasource_google_get_cmd_string,
+  (VikDataSourceProcessFunc)           NULL,
   (VikDataSourceProgressFunc)          NULL,
   (VikDataSourceAddProgressWidgetsFunc)        NULL,
   (VikDataSourceCleanupFunc)           datasource_google_cleanup,
   (VikDataSourceProgressFunc)          NULL,
   (VikDataSourceAddProgressWidgetsFunc)        NULL,
   (VikDataSourceCleanupFunc)           datasource_google_cleanup,
+  (VikDataSourceOffFunc)                NULL,
 };
 
 static gpointer datasource_google_init ( )
 };
 
 static gpointer datasource_google_init ( )
@@ -100,7 +103,7 @@ 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 );
   to_quoted = g_strjoinv( "%20", to_split);
 
   *cmd = g_strdup_printf( GOOGLE_DIRECTIONS_STRING, from_quoted, to_quoted );
-  *input_file_type = g_strdup("google");
+  *input_file_type = g_strdup("kml");
 
   g_free(last_from_str);
   g_free(last_to_str);
 
   g_free(last_from_str);
   g_free(last_to_str);