mapnik/plugins/input/templates/helloworld
2015-02-23 10:36:48 -08:00
..
build.py scons: support MAPNIK_NAME option to customize libmapnik name for custom packaging 2014-06-09 13:55:56 -07:00
hello_datasource.cpp don't call *params.get<std::string>("type"), instead use static datasource::name() 2014-06-26 10:51:24 +01:00
hello_datasource.hpp + replace <boost/shared_ptr.hpp> with <memory> 2013-09-20 14:13:23 +01:00
hello_featureset.cpp fix compile of helloworld plugin 2015-02-23 10:36:48 -08:00
hello_featureset.hpp use const std::unique_ptr<> instead of boost::scoped_ptr<> 2013-09-20 14:22:58 +01:00
Makefile Makefile tweaks for helloworld template plugin 2014-06-16 09:52:26 -07:00
README.md Update README.md 2015-01-21 14:28:12 -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:

<?xml version="1.0" encoding="utf-8"?>
<Map srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" background-color="white">
    <Style name="style">
        <Rule>
            <PointSymbolizer />
            <TextSymbolizer name="[key]" face_name="DejaVu Sans Book" size="10" dx="5" dy="5"/>
        </Rule>
    </Style>
    <Layer name="test" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
        <StyleName>style</StyleName>
        <Datasource>
            <Parameter name="type">hello</Parameter>
        </Datasource>
    </Layer>
</Map>

Or used in python like:

import mapnik
ds = mapnik.Datasource(type="hello")