From f8f79036d04fcef064aff35a9a60aabc3a3f0bf0 Mon Sep 17 00:00:00 2001 From: Christoph Lingg Date: Wed, 15 Feb 2017 12:47:24 +0100 Subject: [PATCH] allow empty map --- staticmap/staticmap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/staticmap/staticmap.py b/staticmap/staticmap.py index d2139d9..d7c25c7 100644 --- a/staticmap/staticmap.py +++ b/staticmap/staticmap.py @@ -247,7 +247,8 @@ def render(self, zoom=None, center=None): """ if not self.lines and not self.markers and not self.polygons and not (center and zoom): - raise RuntimeError("cannot render empty map, add lines / markers / polygons first") + if zoom is None or center is None: + raise RuntimeError("cannot render empty map, either add lines / markers / polygons or specify center and zoom for an empty map") if zoom is None: self.zoom = self._calculate_zoom()