# Get the bounds of the area to render
bbox = [float(x) for x in form.getvalue("bbox").split(",")]
# Get the bounds of the area to render
bbox = [float(x) for x in form.getvalue("bbox").split(",")]
- bbox = mapnik2.forward_(mapnik2.Box2d(*bbox), prj)
+ bbox = mapnik.forward_(mapnik.Box2d(*bbox), prj)
+
+ # Get the style to use
+ style = form.getvalue("style", "default")
- image = mapnik2.Image(map.width, map.height)
- mapnik2.render(map, image)
+ image = mapnik.Image(map.width, map.height)
+ mapnik.render(map, image)
png = image.tostring("png")
output_headers("image/png", "map.png", len(png))
sys.stdout.write(png)
elif form.getvalue("format") == "jpeg":
png = image.tostring("png")
output_headers("image/png", "map.png", len(png))
sys.stdout.write(png)
elif form.getvalue("format") == "jpeg":
- image = mapnik2.Image(map.width, map.height)
- mapnik2.render(map, image)
+ image = mapnik.Image(map.width, map.height)
+ mapnik.render(map, image)
jpeg = image.tostring("jpeg")
output_headers("image/jpeg", "map.jpg", len(jpeg))
sys.stdout.write(jpeg)
elif form.getvalue("format") == "svg":
file = tempfile.NamedTemporaryFile()
surface = cairo.SVGSurface(file.name, map.width, map.height)
jpeg = image.tostring("jpeg")
output_headers("image/jpeg", "map.jpg", len(jpeg))
sys.stdout.write(jpeg)
elif form.getvalue("format") == "svg":
file = tempfile.NamedTemporaryFile()
surface = cairo.SVGSurface(file.name, map.width, map.height)
surface.finish()
output_headers("image/svg+xml", "map.svg", file_size(file))
output_file(file)
elif form.getvalue("format") == "pdf":
file = tempfile.NamedTemporaryFile()
surface = cairo.PDFSurface(file.name, map.width, map.height)
surface.finish()
output_headers("image/svg+xml", "map.svg", file_size(file))
output_file(file)
elif form.getvalue("format") == "pdf":
file = tempfile.NamedTemporaryFile()
surface = cairo.PDFSurface(file.name, map.width, map.height)
surface.finish()
output_headers("application/pdf", "map.pdf", file_size(file))
output_file(file)
elif form.getvalue("format") == "ps":
file = tempfile.NamedTemporaryFile()
surface = cairo.PSSurface(file.name, map.width, map.height)
surface.finish()
output_headers("application/pdf", "map.pdf", file_size(file))
output_file(file)
elif form.getvalue("format") == "ps":
file = tempfile.NamedTemporaryFile()
surface = cairo.PSSurface(file.name, map.width, map.height)