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
with codecs.open(os.path.join(self.destdir, "markers.js"), 'w', encoding='UTF-8') as output:
output.write("overviewer.collections.markerDatas.push([\n")
for marker in markers:
output.write(json.dumps(marker))
if marker != markers[-1]:
output.write(",")
output.write("\n")
output.write("]);\n")
output.write("// This is a generated file. Please do not edit it!\n")
output.write("overviewer.collections.markerDatas.push(\n")
output.write("// --start marker json dump--\n")
json.dump(markers, output, indent=1)
output.write("\n// --end marker json dump--\n")
output.write(");\n")