mapnik/plugins/input/templates/helloworld
Sandro Santilli 018e33cda8 Makefile tweaks for helloworld template plugin
- Do not force use of clang++ to build the plugin (broken on recent debian
   and derivates: https://bugs.debian.org/643959)
 - Do not force clean on install
 - Use -fPIC to build objects (or g++ complains)
2014-06-13 12:57:35 +02:00
..
build.py scons: support MAPNIK_NAME option to customize libmapnik name for custom packaging 2014-06-09 13:32:48 -07:00
hello_datasource.cpp remove bind option for datasources - refs #962 2012-12-17 10:03:07 -08:00
hello_datasource.hpp remove as much mutable as possible 2012-12-17 12:59:15 -08:00
hello_featureset.cpp use icu:: namespace and start isolating icu impl by consistenly using mapnik::value_unicode_string 2013-08-13 18:52:04 -04:00
hello_featureset.hpp fixup includes and value type and params usage across plugins 2013-01-04 09:23:06 -08:00
Makefile Makefile tweaks for helloworld template plugin 2014-06-13 12:57:35 +02:00
README.md tests: make consistent the proj4 string for epsg:4326 2013-01-25 00:49:55 -08:00
test.xml tests: make consistent the proj4 string for epsg:4326 2013-01-25 00:49:55 -08: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')