--- Begin Message ---
I've noticed several posts over the past few months on the web
that magic scissors fails in viking.

Searching the gpsbabel lists, there are some posts that
the maps.google.com "output=js" has changed and gpsbabel
types have had a hard time keeping up with the changes
at maps.google.com.  One suggestion was to use "output=kml"
at maps.google.com and the input_type "kml" instead of
"google" in gpsbabel.

I tried that in viking 0.9.9 and it seems to fix magic scissors
for me.

I've attached the patch I made to 0.9.9 in hopes it will
point people who know the viking code far better than I
in a direction that won't break any other features in viking.
It hasn't broken any features I've used in viking yet,
but I don't use many of the layer types.  Be forewarned though,
this patch might break some feature you use.

Hopefuly though, this patch will help those who maintain
viking to get magic scissors working again without breaking
anything else.  

     Harry McGavran
     w5...@arrl.net



*** ./viking-0.9.9/src/googlesearch.c.orig	Tue Sep  8 14:42:35 2009
--- ./viking-0.9.9/src/googlesearch.c	Sun Sep 13 22:16:15 2009
***************
*** 34,40 ****
  #include "util.h"
  #include "curl_download.h"
  
! #define GOOGLE_SEARCH_URL_FMT "http://maps.google.com/maps?q=%s&output=js";
  #define GOOGLE_SEARCH_PATTERN_1 "{center:{lat:"
  #define GOOGLE_SEARCH_PATTERN_2 ",lng:"
  #define GOOGLE_SEARCH_NOT_FOUND "not understand the location"
--- 34,40 ----
  #include "util.h"
  #include "curl_download.h"
  
! #define GOOGLE_SEARCH_URL_FMT "http://maps.google.com/maps?q=%s&output=kml";
  #define GOOGLE_SEARCH_PATTERN_1 "{center:{lat:"
  #define GOOGLE_SEARCH_PATTERN_2 ",lng:"
  #define GOOGLE_SEARCH_NOT_FOUND "not understand the location"
*** ./viking-0.9.9/src/datasource_google.c.orig	Tue Sep  8 14:42:35 2009
--- ./viking-0.9.9/src/datasource_google.c	Sun Sep 13 22:27:06 2009
***************
*** 31,37 ****
  #include "gpx.h"
  #include "acquire.h"
  
! #define GOOGLE_DIRECTIONS_STRING "maps.google.com/maps?q=from:%s+to:%s&output=js"
  
  typedef struct {
    GtkWidget *from_entry, *to_entry;
--- 31,37 ----
  #include "gpx.h"
  #include "acquire.h"
  
! #define GOOGLE_DIRECTIONS_STRING "maps.google.com/maps?q=from:%s+to:%s&output=kml"
  
  typedef struct {
    GtkWidget *from_entry, *to_entry;
***************
*** 100,106 ****
    to_quoted = g_strjoinv( "%20", to_split);
  
    *cmd = g_strdup_printf( GOOGLE_DIRECTIONS_STRING, from_quoted, to_quoted );
!   *input_file_type = g_strdup("google");
  
    g_free(last_from_str);
    g_free(last_to_str);
--- 100,106 ----
    to_quoted = g_strjoinv( "%20", to_split);
  
    *cmd = g_strdup_printf( GOOGLE_DIRECTIONS_STRING, from_quoted, to_quoted );
!   *input_file_type = g_strdup("kml");
  
    g_free(last_from_str);
    g_free(last_to_str);
*** ./viking-0.9.9/src/viktrwlayer.c.orig	Wed Sep  9 14:16:18 2009
--- ./viking-0.9.9/src/viktrwlayer.c	Sun Sep 13 23:38:24 2009
***************
*** 71,77 ****
  static g_hash_table_remove_all (GHashTable *ght) { g_hash_table_foreach_remove ( ght, (GHRFunc) return_true, FALSE ); }
  #endif
  
! #define GOOGLE_DIRECTIONS_STRING "maps.google.com/maps?q=from:%s,%s+to:%s,%s&output=js"
  #define VIK_TRW_LAYER_TRACK_GC 13
  #define VIK_TRW_LAYER_TRACK_GC_RATES 10
  #define VIK_TRW_LAYER_TRACK_GC_MIN 0
--- 71,77 ----
  static g_hash_table_remove_all (GHashTable *ght) { g_hash_table_foreach_remove ( ght, (GHRFunc) return_true, FALSE ); }
  #endif
  
! #define GOOGLE_DIRECTIONS_STRING "maps.google.com/maps?q=from:%s,%s+to:%s,%s&output=kml"
  #define VIK_TRW_LAYER_TRACK_GC 13
  #define VIK_TRW_LAYER_TRACK_GC_RATES 10
  #define VIK_TRW_LAYER_TRACK_GC_MIN 0
***************
*** 3653,3659 ****
                            g_ascii_dtostr (startlon, G_ASCII_DTOSTR_BUF_SIZE, (gdouble) start.lon),
                            g_ascii_dtostr (endlat, G_ASCII_DTOSTR_BUF_SIZE, (gdouble) end.lat),
                            g_ascii_dtostr (endlon, G_ASCII_DTOSTR_BUF_SIZE, (gdouble) end.lon));
!     a_babel_convert_from_url ( vtl, url, "google", NULL, NULL );
      g_free ( url );
  
      /* see if anything was done -- a track was added or appended to */
--- 3653,3659 ----
                            g_ascii_dtostr (startlon, G_ASCII_DTOSTR_BUF_SIZE, (gdouble) start.lon),
                            g_ascii_dtostr (endlat, G_ASCII_DTOSTR_BUF_SIZE, (gdouble) end.lat),
                            g_ascii_dtostr (endlon, G_ASCII_DTOSTR_BUF_SIZE, (gdouble) end.lon));
!     a_babel_convert_from_url ( vtl, url, "kml", NULL, NULL );
      g_free ( url );
  
      /* see if anything was done -- a track was added or appended to */
*** ./viking-0.9.9/src/babel.c.orig	Tue Sep  8 14:42:35 2009
--- ./viking-0.9.9/src/babel.c	Sun Sep 13 23:41:52 2009
***************
*** 276,282 ****
  
  gboolean a_babel_convert_from_url ( VikTrwLayer *vt, const char *url, const char *input_type, BabelStatusFunc cb, gpointer user_data )
  {
!   static DownloadOptions options = {NULL, 0, a_check_html_file};
    gint fd_src;
    int fetch_ret;
    gboolean ret = FALSE;
--- 276,282 ----
  
  gboolean a_babel_convert_from_url ( VikTrwLayer *vt, const char *url, const char *input_type, BabelStatusFunc cb, gpointer user_data )
  {
!   static DownloadOptions options = {NULL, 0};
    gint fd_src;
    int fetch_ret;
    gboolean ret = FALSE;
Harry G. McGavran, Jr.

E-mail: w5...@arrl.net


--- End Message ---
-- 

Harry G. McGavran, Jr.

E-mail: w5...@arrl.net



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to