maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [PATCH] Set a solid white map background


From: gael . utard
Subject: [Maposmatic-dev] [PATCH] Set a solid white map background
Date: Thu, 29 Mar 2012 12:32:42 +0200

From: Gael UTARD <address@hidden>

The transparent background is rendered with grey by some softwares.

Signed-off-by: Gael UTARD <address@hidden>
---
 ocitysmap2/__init__.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/ocitysmap2/__init__.py b/ocitysmap2/__init__.py
index 026e67e..0448507 100644
--- a/ocitysmap2/__init__.py
+++ b/ocitysmap2/__init__.py
@@ -526,6 +526,13 @@ SELECT ST_AsText(ST_LongestLine(
                 'Unsupported output format: %s!' % output_format.upper()
 
         surface = factory(renderer.paper_width_pt, renderer.paper_height_pt)
+
+        # Set a white background
+        ctx = cairo.Context(surface)
+        ctx.set_source_rgb(1, 1, 1)
+        ctx.rectangle(0, 0, renderer.paper_width_pt, renderer.paper_height_pt)
+        ctx.fill()
+
         renderer.render(surface, dpi, osm_date)
 
         LOG.debug('Writing %s...' % output_filename)
-- 
1.7.5.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]