0

dump markers json out in one shot. Added marker comments.

This commit is contained in:
Andrew Brown
2011-12-04 00:26:29 -05:00
parent e5fed90d04
commit 86c1b8ba15

View File

@@ -204,10 +204,9 @@ class MapGen(object):
# write out the default marker table # write out the default marker table
with codecs.open(os.path.join(self.destdir, "markers.js"), 'w', encoding='UTF-8') as output: with codecs.open(os.path.join(self.destdir, "markers.js"), 'w', encoding='UTF-8') as output:
output.write("overviewer.collections.markerDatas.push([\n") output.write("// This is a generated file. Please do not edit it!\n")
for marker in markers: output.write("overviewer.collections.markerDatas.push(\n")
output.write(json.dumps(marker)) output.write("// --start marker json dump--\n")
if marker != markers[-1]: json.dump(markers, output, indent=1)
output.write(",") output.write("\n// --end marker json dump--\n")
output.write("\n") output.write(");\n")
output.write("]);\n")