Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

no need for ifdefs, calling instance() should work for older mapnik a…

…s well
  • Loading branch information...
commit 552a63f378077d0e2bec8549ba1214227d1f4d53 1 parent a344edc
@springmeyer springmeyer authored
Showing with 0 additions and 16 deletions.
  1. +0 −4 src/mapnik_datasource.cpp
  2. +0 −12 src/mapnik_plugins.hpp
View
4 src/mapnik_datasource.cpp
@@ -104,11 +104,7 @@ Handle<Value> Datasource::New(const Arguments& args)
mapnik::datasource_ptr ds;
try
{
-#if MAPNIK_VERSION >= 200200
ds = mapnik::datasource_cache::instance()->create(params, bind);
-#else
- ds = mapnik::datasource_cache::create(params, bind);
-#endif
}
catch (std::exception const& ex)
{
View
12 src/mapnik_plugins.hpp
@@ -26,11 +26,7 @@ namespace node_mapnik {
static inline Handle<Value> available_input_plugins(const Arguments& args)
{
HandleScope scope;
-#if MAPNIK_VERSION >= 200200
std::vector<std::string> names = mapnik::datasource_cache::instance()->plugin_names();
-#else
- std::vector<std::string> names = mapnik::datasource_cache::plugin_names();
-#endif
Local<Array> a = Array::New(names.size());
for (unsigned i = 0; i < names.size(); ++i)
{
@@ -46,18 +42,10 @@ static inline Handle<Value> register_datasources(const Arguments& args)
if (args.Length() != 1 || !args[0]->IsString())
return ThrowException(Exception::TypeError(
String::New("first argument must be a path to a directory of mapnik input plugins")));
-#if MAPNIK_VERSION >= 200200
std::vector<std::string> names_before = mapnik::datasource_cache::instance()->plugin_names();
-#else
- std::vector<std::string> names_before = mapnik::datasource_cache::plugin_names();
-#endif
std::string path = TOSTR(args[0]);
mapnik::datasource_cache::instance()->register_datasources(path);
-#if MAPNIK_VERSION >= 200200
std::vector<std::string> names_after = mapnik::datasource_cache::instance()->plugin_names();
-#else
- std::vector<std::string> names_after = mapnik::datasource_cache::plugin_names();
-#endif
if (names_after.size() > names_before.size())
return scope.Close(True());
return scope.Close(False());
Please sign in to comment.
Something went wrong with that request. Please try again.