diff --git a/plugins/input/templates/helloworld/hello_featureset.cpp b/plugins/input/templates/helloworld/hello_featureset.cpp index eb3f19a10..b24d4d37e 100644 --- a/plugins/input/templates/helloworld/hello_featureset.cpp +++ b/plugins/input/templates/helloworld/hello_featureset.cpp @@ -16,6 +16,12 @@ mapnik::feature_ptr hello_featureset::next() { if (feature_id_ == 1) { + // let us pretend it just has one column/attribute name + std::string attribute("key"); + + // the featureset context needs to know the field schema + ctx_->push(attribute); + // create a new feature mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx_,feature_id_)); @@ -24,7 +30,7 @@ mapnik::feature_ptr hello_featureset::next() // create an attribute pair of key:value UnicodeString ustr = tr_->transcode("hello world!"); - feature->put("key",ustr); + feature->put(attribute,ustr); // we need a geometry to display so just for fun here // we take the center of the bbox that was used to query