mapnik/plugins/input/templates/helloworld
Manel Clos 8f7083d14d Add tolerance parameter to features_at_point
Make map.query_point() always pass tolerance to datasources
2012-09-28 15:12:10 +02:00
..
build.py link to boost system 2012-02-09 16:00:39 -08:00
hello_datasource.cpp Add tolerance parameter to features_at_point 2012-09-28 15:12:10 +02:00
hello_datasource.hpp Add tolerance parameter to features_at_point 2012-09-28 15:12:10 +02:00
hello_featureset.cpp properly populate the context 2012-07-10 14:51:13 -07:00
hello_featureset.hpp merge master with feature_impl 2012-01-17 17:47:27 -05:00
Makefile recompile stale targets during deploy 2012-07-10 14:50:43 -07:00
README.md update readmes for template plugins 2012-07-10 14:54:05 -07:00
test.xml upgrade syntax to mapnik2 2011-04-09 05:35:25 +00:00

hello world plugin

This is a very simple sample plugin. It is designed to help developers see the skeletal basics needed to achieve a functional datasource plugin.

It is not a model plugin of best practices as much as a model of the bare minimum you need to have a working plugin that returns a single feature.

Code comments attempt to highlight which code is mandatory, which is simply recommended, and which is purely fluff used to get the plugin to actually show some data.

When added to a map it provides a single point geometry representing the center of any query. This means that it should place a point in the middle of any map tile and display a "hello world!" label if used like:

style hello

Or used in python like:

from mapnik import * m = Map(600,400) m.background = Color('white') s = Style() r = Rule() r.symbols.append(PointSymbolizer()) t = TextSymbolizer(Expression("[key]"),"DejaVu Sans Book",10,Color('black')) t.displacement = (15,15) r.symbols.append(t) s.rules.append(r) m.append_style('style',s) ds = Datasource(type="hello") l = Layer('test') l.styles.append('style') l.datasource = ds m.layers.append(l) m.zoom_all() render_to_file(m,'test.png')