0

fixed up comments in googlemap.py, moved region.js to web_assets

This commit is contained in:
Andrew Brown
2011-12-03 23:32:45 -05:00
parent 3bdf380b6f
commit e5fed90d04
4 changed files with 24 additions and 17 deletions

View File

@@ -345,8 +345,9 @@ Less Useful Options
.. cmdoption:: --skip-js
Skip the generation and output of markers.js and regions.js to the output
directory.
Skip the generation and output of markers.js, which is typically generated
from the signs in your world. This is useful if you want to generate your
own and don't want this one getting in the way.
**Settings file:**
Option name: ``skipjs``

View File

@@ -227,7 +227,7 @@ def main():
parser.add_option("--check-terrain", dest="check_terrain", helptext="Prints the location and hash of terrain.png, useful for debugging terrain.png problems", action="store_true", advanced=False, commandLineOnly=True)
parser.add_option("-q", "--quiet", dest="quiet", action="count", default=0, helptext="Print less output. You can specify this option multiple times.")
parser.add_option("-v", "--verbose", dest="verbose", action="count", default=0, helptext="Print more output. You can specify this option multiple times.")
parser.add_option("--skip-js", dest="skipjs", action="store_true", helptext="Don't output marker.js or regions.js")
parser.add_option("--skip-js", dest="skipjs", action="store_true", helptext="Don't output marker.js")
parser.add_option("--no-signs", dest="nosigns", action="store_true", helptext="Don't output signs to markers.js")
parser.add_option("--north-direction", dest="north_direction", action="store", helptext="Specifies which corner of the screen north will point to. Defaults to whatever the current map uses, or lower-left for new maps. Valid options are: " + ", ".join(avail_north_dirs) + ".", type="choice", default="auto", choices=avail_north_dirs)
parser.add_option("--changelist", dest="changelist", action="store", helptext="Output list of changed tiles to file. If the file exists, its contents will be overwritten.",advanced=True)

View File

@@ -0,0 +1,9 @@
// This is just an example. You can run some scripts to generate regions that
// will be drawn here.
overviewer.collections.regionDatas.push([
// {"color": "#FFAA00", "opacity": 0.5, "closed": true, "path": [
// {"x": 0, "y": 0, "z": 0},
// {"x": 0, "y": 10, "z": 0},
// {"x": 0, "y": 0, "z": 10}
// ]},
]);

View File

@@ -72,7 +72,11 @@ class MapGen(object):
"""Generates a Google Maps interface for the given list of
quadtrees. All of the quadtrees must have the same destdir,
image format, and world.
Note:tiledir for each quadtree should be unique. By default the tiledir is determined by the rendermode"""
Note:tiledir for each quadtree should be unique. By default the tiledir
is determined by the rendermode
"""
self.skipjs = configInfo.get('skipjs', False)
self.nosigns = configInfo.get('nosigns', False)
@@ -94,8 +98,9 @@ class MapGen(object):
self.quadtrees = quadtrees
def go(self, procs):
"""Writes out config.js, marker.js, and region.js
Copies web assets into the destdir"""
"""Writes out overviewerConfig.js and does copying of the other static web assets
"""
zoomlevel = self.p
bgcolor = (int(self.bg_color[1:3],16), int(self.bg_color[3:5],16), int(self.bg_color[5:7],16), 0)
@@ -171,6 +176,9 @@ class MapGen(object):
def finalize(self):
"""Write out persistent data file and marker listings file
"""
# since we will only discover PointsOfInterest in chunks that need to be
# [re]rendered, POIs like signs in unchanged chunks will not be listed
# in self.world.POI. To make sure we don't remove these from markers.js
@@ -203,14 +211,3 @@ class MapGen(object):
output.write(",")
output.write("\n")
output.write("]);\n")
# write out the default (empty, but documented) region table
with codecs.open(os.path.join(self.destdir, "regions.js"), 'w', encoding='UTF-8') as output:
output.write('overviewer.collections.regionDatas.push([\n')
output.write(' // {"color": "#FFAA00", "opacity": 0.5, "closed": true, "path": [\n')
output.write(' // {"x": 0, "y": 0, "z": 0},\n')
output.write(' // {"x": 0, "y": 10, "z": 0},\n')
output.write(' // {"x": 0, "y": 0, "z": 10}\n')
output.write(' // ]},\n')
output.write(']);')