Update README.md

This commit is contained in:
Dane Springmeyer 2015-01-21 14:28:12 -08:00
parent 39d8d65343
commit d6175adb1a

View file

@ -14,6 +14,7 @@ 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
<?xml version="1.0" encoding="utf-8"?>
<Map srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" background-color="white">
<Style name="style">
@ -29,25 +30,11 @@ the middle of any map tile and display a "hello world!" label if used like:
</Datasource>
</Layer>
</Map>
```
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')
```
import mapnik
ds = mapnik.Datasource(type="hello")
```