]> git.street.me.uk Git - andy/viking.git/blobdiff - src/modules.c
Fix recent commit: 4dc72a1d407b81853d0093871cff45ef1f47d1b8
[andy/viking.git] / src / modules.c
index 9ab5d40c99b37bcbb5678655d956dfe2226833b4..85b6820bb94391b9883c7bdfe84e07cd97f2e60c 100644 (file)
@@ -228,8 +228,18 @@ register_loadable_types(void)
   g_debug("%d types loaded", (int)sizeof(types)/(int)sizeof(GType));
 }
 
+/**
+ * First stage initialization
+ * Can not use a_get_preferences() yet...
+ * See comment in main.c
+ */
 void modules_init()
 {
+// OSM done first so this will be the default service for searching/routing/etc...
+#ifdef VIK_CONFIG_OPENSTREETMAP
+  osm_init();
+  osm_traces_init();
+#endif
 #ifdef VIK_CONFIG_BING
   bing_init();
 #endif
@@ -242,10 +252,6 @@ void modules_init()
 #ifdef VIK_CONFIG_TERRASERVER
   terraserver_init();
 #endif
-#ifdef VIK_CONFIG_OPENSTREETMAP
-  osm_init();
-  osm_traces_init();
-#endif
 #ifdef VIK_CONFIG_BLUEMARBLE
   bluemarble_init();
 #endif
@@ -266,6 +272,22 @@ void modules_init()
   modules_load_config ();
 }
 
+/**
+ * modules_post_init:
+ *
+ * Secondary stage initialization
+ * Can now use a_get_preferences() and a_babel_available()
+ */
+void modules_post_init ()
+{
+#ifdef VIK_CONFIG_GOOGLE
+  google_post_init();
+#endif
+#ifdef HAVE_LIBMAPNIK
+  vik_mapnik_layer_post_init();
+#endif
+}
+
 /**
  *
  */