X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/7363caa739bd64724ec6b12208d4f30f06258845..ccab0e9e7869f120d20bd41bac6043b37c88b2ec:/src/google.c?ds=sidebyside diff --git a/src/google.c b/src/google.c index 16301b5d..c7e7ecc2 100644 --- a/src/google.c +++ b/src/google.c @@ -28,11 +28,58 @@ #include "google.h" #include "vikexttools.h" #include "vikwebtoolcenter.h" +#include "vikgoto.h" +#include "googlesearch.h" +#include "vikrouting.h" +#include "vikroutingwebengine.h" +#include "babel.h" void google_init () { // Webtools - VikWebtoolCenter *webtool = vik_webtool_center_new_with_members ( _("Google"), "http://maps.google.com/maps?f=q&hl=fr&geocode=&ie=UTF8&ll=%s,%s&z=%d&iwloc=addr" ); + VikWebtoolCenter *webtool = vik_webtool_center_new_with_members ( _("Google"), "http://maps.google.com/maps/@%s,%s,%dz" ); vik_ext_tools_register ( VIK_EXT_TOOL ( webtool ) ); g_object_unref ( webtool ); + + // Goto + /* + * Google no longer supports the API we used + * + GoogleGotoTool *gototool = google_goto_tool_new ( ); + vik_goto_register ( VIK_GOTO_TOOL ( gototool ) ); + g_object_unref ( gototool ); + */ } +/** + * Delayed initialization part as the check for gpsbabel availability needs to have been performed + */ +void google_post_init () +{ + // Routing + /* Google Directions service as routing engine. + * + * Technical details are available here: + * https://developers.google.com/maps/documentation/directions/#DirectionsResponses + * + * gpsbabel supports this format. + */ + /* + * Google no longer supports the API we used + * + if ( a_babel_available() ) { + VikRoutingEngine *routing = g_object_new ( VIK_ROUTING_WEB_ENGINE_TYPE, + "id", "google", + "label", "Google", + "format", "google", + "url-base", "http://maps.google.com/maps?output=js&q=", + "url-start-ll", "from:%s,%s", + "url-stop-ll", "+to:%s,%s", + "url-start-dir", "from:%s", + "url-stop-dir", "+to:%s", + "referer", "http://maps.google.com/", + NULL); + vik_routing_register ( VIK_ROUTING_ENGINE ( routing ) ); + g_object_unref ( routing ); + } + */ +}