From a2b1f238d9c72f3a8506f9f901a87af7731101b3 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Sun, 10 Apr 2011 04:38:42 -0400 Subject: [PATCH] changed markers.js to output one marker per line this has been requested *many* times, because it makes it easier to (1) learn what format markers.js uses, and (2) write shell scripts that process markers.js. It shouldn't break existing processors that use json loaders, and does not drastically increase file size (just one extra byte per ~70). --- googlemap.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/googlemap.py b/googlemap.py index 2321049..f6f271e 100644 --- a/googlemap.py +++ b/googlemap.py @@ -144,7 +144,13 @@ class MapGen(object): # write out the default marker table with open(os.path.join(self.destdir, "markers.js"), 'w') as output: - output.write("var markerData=%s" % json.dumps(self.world.POI)) + output.write("var markerData=[\n") + for marker in self.world.POI: + output.write(json.dumps(marker)) + if marker != self.world.POI[-1]: + output.write(",") + output.write("\n") + output.write("]\n") # save persistent data self.world.persistentData['POI'] = self.world.POI