fixed up comments in googlemap.py, moved region.js to web_assets
This commit is contained in:
@@ -345,8 +345,9 @@ Less Useful Options
|
|||||||
|
|
||||||
.. cmdoption:: --skip-js
|
.. cmdoption:: --skip-js
|
||||||
|
|
||||||
Skip the generation and output of markers.js and regions.js to the output
|
Skip the generation and output of markers.js, which is typically generated
|
||||||
directory.
|
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:**
|
**Settings file:**
|
||||||
Option name: ``skipjs``
|
Option name: ``skipjs``
|
||||||
|
|||||||
@@ -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("--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("-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("-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("--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("--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)
|
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)
|
||||||
|
|||||||
9
overviewer_core/data/web_assets/regions.js
Normal file
9
overviewer_core/data/web_assets/regions.js
Normal 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}
|
||||||
|
// ]},
|
||||||
|
]);
|
||||||
@@ -72,7 +72,11 @@ class MapGen(object):
|
|||||||
"""Generates a Google Maps interface for the given list of
|
"""Generates a Google Maps interface for the given list of
|
||||||
quadtrees. All of the quadtrees must have the same destdir,
|
quadtrees. All of the quadtrees must have the same destdir,
|
||||||
image format, and world.
|
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.skipjs = configInfo.get('skipjs', False)
|
||||||
self.nosigns = configInfo.get('nosigns', False)
|
self.nosigns = configInfo.get('nosigns', False)
|
||||||
@@ -94,8 +98,9 @@ class MapGen(object):
|
|||||||
self.quadtrees = quadtrees
|
self.quadtrees = quadtrees
|
||||||
|
|
||||||
def go(self, procs):
|
def go(self, procs):
|
||||||
"""Writes out config.js, marker.js, and region.js
|
"""Writes out overviewerConfig.js and does copying of the other static web assets
|
||||||
Copies web assets into the destdir"""
|
|
||||||
|
"""
|
||||||
zoomlevel = self.p
|
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)
|
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):
|
def finalize(self):
|
||||||
|
"""Write out persistent data file and marker listings file
|
||||||
|
|
||||||
|
"""
|
||||||
# since we will only discover PointsOfInterest in chunks that need to be
|
# since we will only discover PointsOfInterest in chunks that need to be
|
||||||
# [re]rendered, POIs like signs in unchanged chunks will not be listed
|
# [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
|
# 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(",")
|
||||||
output.write("\n")
|
output.write("\n")
|
||||||
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(']);')
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user