Changeset 1148

Show
Ignore:
Timestamp:
05/19/09 20:18:46 (15 months ago)
Author:
dane
Message:

via a layer object pickle datasource params rather than the datasource object itself - see #345

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/bindings/python/mapnik_layer.cpp

    r1092 r1148  
    3131#include <mapnik/layer.hpp> 
    3232#include <mapnik/datasource.hpp> 
     33#include <mapnik/datasource_cache.hpp> 
    3334 
    3435using mapnik::Layer; 
    3536using mapnik::parameters; 
    36 using mapnik::datasource; 
     37using mapnik::datasource_cache; 
    3738 
    3839 
     
    5455            s.append(style_names[i]); 
    5556        }       
    56         return boost::python::make_tuple(l.abstract(),l.title(),l.clear_label_cache(),l.getMinZoom(),l.getMaxZoom(),l.isQueryable(),l.datasource(),s); 
     57        return boost::python::make_tuple(l.abstract(),l.title(),l.clear_label_cache(),l.getMinZoom(),l.getMaxZoom(),l.isQueryable(),l.datasource()->params(),s); 
    5758   } 
    5859 
     
    102103        if (state[6]) 
    103104        { 
    104             boost::shared_ptr<datasource> ds = extract<boost::shared_ptr<datasource> >(state[6]); 
    105             l.set_datasource(ds); 
     105            mapnik::parameters params = extract<parameters>(state[6]); 
     106            l.set_datasource(datasource_cache::instance()->create(params)); 
    106107        } 
    107108