From c2bf7ff34e02b5add60799d54df300f24c143781 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Wed, 8 Jun 2011 14:41:43 -0400 Subject: [PATCH] added --no-signs option --- googlemap.py | 12 +++++++++--- overviewer.py | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/googlemap.py b/googlemap.py index daf0e0e..0e99639 100644 --- a/googlemap.py +++ b/googlemap.py @@ -66,7 +66,8 @@ class MapGen(object): image format, and world. Note:tiledir for each quadtree should be unique. By default the tiledir is determined by the rendermode""" - self.skipjs = configInfo.get('skipjs', None) + self.skipjs = configInfo.get('skipjs', False) + self.nosigns = configInfo.get('nosigns', False) self.web_assets_hook = configInfo.get('web_assets_hook', None) self.web_assets_path = configInfo.get('web_assets_path', None) self.bg_color = configInfo.get('bg_color') @@ -153,13 +154,18 @@ class MapGen(object): # we need to merge self.world.POI with the persistant data in world.PersistentData self.world.POI += filter(lambda x: x['type'] != 'spawn', self.world.persistentData['POI']) + + if self.nosigns: + markers = filter(lambda x: x['type'] != 'sign', self.world.POI) + else: + markers = self.world.POI # write out the default marker table with open(os.path.join(self.destdir, "markers.js"), 'w') as output: output.write("overviewer.collections.markerDatas.push([\n") - for marker in self.world.POI: + for marker in markers: output.write(json.dumps(marker)) - if marker != self.world.POI[-1]: + if marker != markers[-1]: output.write(",") output.write("\n") output.write("]);\n") diff --git a/overviewer.py b/overviewer.py index 22a103c..1bf6790 100755 --- a/overviewer.py +++ b/overviewer.py @@ -107,6 +107,7 @@ def main(): parser.add_option("-q", "--quiet", dest="quiet", action="count", default=0, help="Print less output. You can specify this option multiple times.") parser.add_option("-v", "--verbose", dest="verbose", action="count", default=0, help="Print more output. You can specify this option multiple times.") parser.add_option("--skip-js", dest="skipjs", action="store_true", help="Don't output marker.js or regions.js") + parser.add_option("--no-signs", dest="nosigns", action="store_true", help="Don't output signs to markers.js") parser.add_option("--display-config", dest="display_config", action="store_true", help="Display the configuration parameters, but don't render the map. Requires all required options to be specified", commandLineOnly=True) #parser.add_option("--write-config", dest="write_config", action="store_true", help="Writes out a sample config file", commandLineOnly=True)