[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH 04/22] multi-page: show page number at the botto
From: |
Thomas Petazzoni |
Subject: |
[Maposmatic-dev] [PATCH 04/22] multi-page: show page number at the bottom of each page |
Date: |
Fri, 30 Mar 2012 13:00:21 +0200 |
The rendering is quite crude at the moment. Improvements later.
Signed-off-by: Thomas Petazzoni <address@hidden>
---
ocitysmap2/layoutlib/multi_page_renderer.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/ocitysmap2/layoutlib/multi_page_renderer.py
b/ocitysmap2/layoutlib/multi_page_renderer.py
index 59aa001..45c94e3 100644
--- a/ocitysmap2/layoutlib/multi_page_renderer.py
+++ b/ocitysmap2/layoutlib/multi_page_renderer.py
@@ -217,7 +217,7 @@ class MultiPageRenderer(Renderer):
def render(self, cairo_surface, dpi, osm_date):
ctx = cairo.Context(cairo_surface)
- for c in self.canvas:
+ for i, c in enumerate(self.canvas):
ctx.save()
# Prepare to draw the map at the right location
@@ -233,6 +233,13 @@ class MultiPageRenderer(Renderer):
mapnik.render(rendered_map, ctx)
ctx.restore()
+ # Render the page number
+ ctx.save()
+
ctx.translate(commons.convert_pt_to_dots(self._usable_area_width_pt),
+
commons.convert_pt_to_dots(self._usable_area_height_pt))
+ Renderer._draw_centered_text(ctx, str(i + 1), 0, 0)
+ ctx.restore()
+
ctx.restore()
cairo_surface.show_page()
--
1.7.4.1
- [Maposmatic-dev] Implementation of a multi-page renderer, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 01/22] Initial version of a multi-page renderer, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 03/22] multi-page: add a shape file that greys out the overlayed area between pages, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 06/22] multi-page: add grid and grid labels, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 05/22] multi-page: differentiate overlap margin and grayed margin, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 04/22] multi-page: show page number at the bottom of each page,
Thomas Petazzoni <=
- [Maposmatic-dev] [PATCH 07/22] indexlib: add page_number to IndexItem, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 02/22] coords: add BoundingBox::as_javascript() method, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 08/22] indexlib: do not raise exception when index is empty, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 09/22] indexlib: villages section is not of street type, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 10/22] renderers: pass the db connection to the Renderer class constructor, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 12/22] indexlib: render page number as part of the street/amenity location, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 15/22] indexlib: properly differentiate the page_number=None and page_number=0 cases, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 13/22] multi-page: add in dex rendering with a new MultiPageStreetIndexRenderer cl ass, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 11/22] multi-page: prepare data for index generation, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 14/22] multi-page: remove multiple debugging outputs, Thomas Petazzoni, 2012/03/30