##
+AC_ARG_WITH(geonames_username,
+ [AC_HELP_STRING([--with-geonames_username],
+ [Username for the GeoNames webservice.
+ Please register your own if you're going to distribute the
+ package, as requests are limited per username.])],
+ [VIK_CONFIG_GEONAMES_USERNAME="\"${withval}\""],
+ [VIK_CONFIG_GEONAMES_USERNAME="\"$PACKAGE\""])
+AC_DEFINE_UNQUOTED(VIK_CONFIG_GEONAMES_USERNAME, ${VIK_CONFIG_GEONAMES_USERNAME}, [geonames username])
+
+
AC_ARG_WITH(mapcache,
[AC_HELP_STRING([--with-mapcache],
[specify the size of the map cache in MB (default is 128)])],
Mapnik Rendering Support (C++) : $ac_cv_enable_mapnik
Size of map cache (in memory) : ${VIK_CONFIG_MAPCACHE_SIZE}
Age of tiles (in seconds) : ${VIK_CONFIG_DEFAULT_TILE_AGE}
+GeoNames user : ${VIK_CONFIG_GEONAMES_USERNAME}
Man page generation : $ac_cv_enable_man
Documentation (+HTML) : ${enable_gtk_doc} (HTML: ${enable_gtk_doc_html})
-------------------------------------------
void geonames_init () {
// Goto
VikGotoXmlTool *geonames = VIK_GOTO_XML_TOOL ( g_object_new ( VIK_GOTO_XML_TOOL_TYPE, "label", "Geonames",
- "url-format", "http://api.geonames.org/search?q=%s&maxRows=1&lang=en&style=short&username=viking",
+ "url-format", "http://api.geonames.org/search?q=%s&maxRows=1&lang=en&style=short&username="VIK_CONFIG_GEONAMES_USERNAME,
"lat-path", "/geonames/geoname/lat",
"lon-path", "/geonames/geoname/lng",
NULL ) );
// ATM decided it's not essential enough to warrant putting in the preferences
#define GEONAMES_MAX_ENTRIES 20
-#define GEONAMES_WIKIPEDIA_URL_FMT "http://api.geonames.org/wikipediaBoundingBoxJSON?formatted=true&north=%s&south=%s&east=%s&west=%s&lang=%s&maxRows=%d&username=viking"
+#define GEONAMES_WIKIPEDIA_URL_FMT "http://api.geonames.org/wikipediaBoundingBoxJSON?formatted=true&north=%s&south=%s&east=%s&west=%s&lang=%s&maxRows=%d&username="VIK_CONFIG_GEONAMES_USERNAME
#define GEONAMES_FEATURE_PATTERN "\"feature\": \""
#define GEONAMES_LONGITUDE_PATTERN "\"lng\": "