]> git.street.me.uk Git - andy/viking.git/commitdiff
Add configuration options for OpenAerial and BlueMarble
authorGuilhem Bonnefille <guilhem.bonnefille@gmail.com>
Thu, 18 Dec 2008 17:17:56 +0000 (17:17 +0000)
committerGuilhem Bonnefille <guilhem.bonnefille@gmail.com>
Thu, 18 Dec 2008 17:17:56 +0000 (17:17 +0000)
configure.ac
src/osm.c

index fece18492aae9270c26fb789f1fe1b8655dffe81..26dd74d55511a17512d64eee555cda9a61d56985 100644 (file)
@@ -136,6 +136,34 @@ case $ac_cv_enable_openstreetmap in
 esac
 AM_CONDITIONAL([OPENSTREETMAP], [test x$ac_cv_enable_openstreetmap = xyes])
 
+# BlueMarble
+AC_ARG_ENABLE(bluemarble, AC_HELP_STRING([--enable-bluemarble],
+              [enable BlueMarble stuff (default is enable)]),
+              [ac_cv_enable_bluemarble=$enableval],
+              [ac_cv_enable_bluemarble=yes])
+AC_CACHE_CHECK([whether to enable BlueMarble stuff],
+               [ac_cv_enable_bluemarble], [ac_cv_enable_bluemarble=yes])
+case $ac_cv_enable_bluemarble in
+  yes)
+    AC_DEFINE(VIK_CONFIG_BLUEMARBLE, [], [BLUEMARBLE STUFF])
+    ;;
+esac
+AM_CONDITIONAL([BLUEMARBLE], [test x$ac_cv_enable_bluemarble = xyes])
+
+# OpenAerial
+AC_ARG_ENABLE(openaerial, AC_HELP_STRING([--enable-openaerial],
+              [enable OpenAerial stuff (default is enable)]),
+              [ac_cv_enable_openaerial=$enableval],
+              [ac_cv_enable_openaerial=yes])
+AC_CACHE_CHECK([whether to enable OpenAerial stuff],
+               [ac_cv_enable_openaerial], [ac_cv_enable_openaerial=yes])
+case $ac_cv_enable_openaerial in
+  yes)
+    AC_DEFINE(VIK_CONFIG_OPENAERIAL, [], [OPENAERIAL STUFF])
+    ;;
+esac
+AM_CONDITIONAL([OPENAERIAL], [test x$ac_cv_enable_openaerial = xyes])
+
 AC_ARG_ENABLE(geocaches, AC_HELP_STRING([--enable-geocaches],
              [enable Geocaches Acquire (default is disable).]),
               [ac_cv_enable_geocaches=$enableval],
index 2152b197493a8a0903ad52b1e950037aaf2049f7..18c10a5de5382934d3f010af1732a4624060380e 100644 (file)
--- a/src/osm.c
+++ b/src/osm.c
@@ -45,8 +45,12 @@ static int osm_maplint_download ( MapCoord *src, const gchar *dest_fn );
 static int osm_mapnik_download ( MapCoord *src, const gchar *dest_fn );
 static int osm_osmarender_download ( MapCoord *src, const gchar *dest_fn );
 static int osm_cycle_download ( MapCoord *src, const gchar *dest_fn );
+#ifdef VIK_CONFIG_BLUEMARBLE
 static int bluemarble_download ( MapCoord *src, const gchar *dest_fn );
+#endif
+#ifdef VIK_CONFIG_OPENAERIAL
 static int openaerialmap_download ( MapCoord *src, const gchar *dest_fn );
+#endif
 
 static DownloadOptions osm_options = { NULL, 0, a_check_map_file };
 
@@ -56,17 +60,25 @@ void osm_init () {
   VikMapsLayer_MapType mapnik_type = { 13, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, osm_coord_to_mapcoord, osm_mapcoord_to_center_coord, osm_mapnik_download };  VikMapsLayer_MapType maplint_type = { 14, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, osm_coord_to_mapcoord, osm_mapcoord_to_center_coord, osm_maplint_download };
   VikMapsLayer_MapType cycle_type = { 17, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, osm_coord_to_mapcoord, osm_mapcoord_to_center_coord, osm_cycle_download };
 
+#ifdef VIK_CONFIG_BLUEMARBLE
   VikMapsLayer_MapType bluemarble_type = { 15, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, osm_coord_to_mapcoord, osm_mapcoord_to_center_coord, bluemarble_download };
+#endif
 
+#ifdef VIK_CONFIG_OPENAERIAL
   VikMapsLayer_MapType openaerialmap_type = { 20, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, osm_coord_to_mapcoord, osm_mapcoord_to_center_coord, openaerialmap_download };
+#endif
 
   maps_layer_register_type("OpenStreetMap (Osmarender)", 12, &osmarender_type);
   maps_layer_register_type("OpenStreetMap (Mapnik)", 13, &mapnik_type);
   maps_layer_register_type("OpenStreetMap (Maplint)", 14, &maplint_type);
   maps_layer_register_type("OpenStreetMap (Cycle)", 17, &cycle_type);
 
+#ifdef VIK_CONFIG_BLUEMARBLE
   maps_layer_register_type("BlueMarble", 15, &bluemarble_type);
+#endif
+#ifdef VIK_CONFIG_OPENAERIAL
   maps_layer_register_type("OpenAerialMap", 20, &openaerialmap_type);
+#endif
 
   // Webtools
   VikWebtoolCenter *webtool = NULL;
@@ -156,6 +168,7 @@ static int osm_osmarender_download ( MapCoord *src, const gchar *dest_fn )
    return res;
 }
 
+#ifdef VIK_CONFIG_BLUEMARBLE
 static int bluemarble_download ( MapCoord *src, const gchar *dest_fn )
 {
    int res = -1;
@@ -166,7 +179,9 @@ static int bluemarble_download ( MapCoord *src, const gchar *dest_fn )
    return res;
 
 }
+#endif
    
+#ifdef VIK_CONFIG_OPENAERIAL
 static int openaerialmap_download ( MapCoord *src, const gchar *dest_fn )
 {
    int res = -1;
@@ -176,6 +191,7 @@ static int openaerialmap_download ( MapCoord *src, const gchar *dest_fn )
    g_free ( uri );
    return res;
 }
+#endif
 
 static int osm_cycle_download ( MapCoord *src, const gchar *dest_fn )
 {