Merge branches 'config-include', 'hashchange', 'poi-polylines', 'showlocationmarker' and 'signed-timestamps'
This commit is contained in:
@@ -294,7 +294,7 @@ the form ``key = value``. Two items take a different form:, ``worlds`` and
|
||||
|
||||
* ``messages=dict(totalTiles=<string>, renderCompleted=<string>, renderProgress=<string>)``
|
||||
Customises messages displayed in browser. All three messages must be
|
||||
defined as follows:
|
||||
defined similar to the following:
|
||||
|
||||
* ``totalTiles="Rendering %d tiles"``
|
||||
The ``%d`` format string will be replaced with the total number of
|
||||
@@ -304,9 +304,9 @@ the form ``key = value``. Two items take a different form:, ``worlds`` and
|
||||
The three format strings will be replaced with the number of hours.
|
||||
minutes and seconds taken to complete this render.
|
||||
|
||||
* ``renderProgress="Rendered %d of %d tiles (%d%%)"``
|
||||
The three format strings will be replaced with the number of tiles
|
||||
completed, the total number of tiles and the percentage complete
|
||||
* ``renderProgress="Rendered %d of %d tiles (%d%% ETA:%s)""``
|
||||
The four format strings will be replaced with the number of tiles
|
||||
completed, the total number of tiles, the percentage complete, and the ETA.
|
||||
|
||||
Format strings are explained here: http://docs.python.org/library/stdtypes.html#string-formatting
|
||||
All format strings must be present in your custom messages.
|
||||
@@ -529,6 +529,12 @@ values. The valid configuration keys are listed below.
|
||||
|
||||
**Default:** Automatically set to most detailed zoom level
|
||||
|
||||
``showlocationmarker``
|
||||
Allows you to specify whether to show the location marker when accessing a URL
|
||||
with coordinates specified.
|
||||
|
||||
**Default:** ``True``
|
||||
|
||||
``base``
|
||||
Allows you to specify a remote location for the tile folder, useful if you
|
||||
rsync your map's images to a remote server. Leave a trailing slash and point
|
||||
|
||||
@@ -460,7 +460,7 @@ dir but you forgot to put quotes around the directory, since it contains spaces.
|
||||
|
||||
# only pass to the TileSet the options it really cares about
|
||||
render['name'] = render_name # perhaps a hack. This is stored here for the asset manager
|
||||
tileSetOpts = util.dict_subset(render, ["name", "imgformat", "renderchecks", "rerenderprob", "bgcolor", "defaultzoom", "imgquality", "optimizeimg", "rendermode", "worldname_orig", "title", "dimension", "changelist", "showspawn", "overlay", "base", "poititle", "maxzoom"])
|
||||
tileSetOpts = util.dict_subset(render, ["name", "imgformat", "renderchecks", "rerenderprob", "bgcolor", "defaultzoom", "imgquality", "optimizeimg", "rendermode", "worldname_orig", "title", "dimension", "changelist", "showspawn", "overlay", "base", "poititle", "maxzoom", "showlocationmarker"])
|
||||
tileSetOpts.update({"spawn": w.find_true_spawn()}) # TODO find a better way to do this
|
||||
tset = tileset.TileSet(w, rset, assetMrg, tex, tileSetOpts, tileset_dir)
|
||||
tilesets.append(tset)
|
||||
|
||||
@@ -95,7 +95,7 @@ directory.
|
||||
'queryMarker': 'http://google-maps-icons.googlecode.com/files/regroup.png'
|
||||
}
|
||||
dump['CONST']['mapDivId'] = 'mcmap'
|
||||
dump['CONST']['regionStrokeWeight'] = 2
|
||||
dump['CONST']['regionStrokeWeight'] = 2 # Obselete
|
||||
dump['CONST']['UPPERLEFT'] = world.UPPER_LEFT;
|
||||
dump['CONST']['UPPERRIGHT'] = world.UPPER_RIGHT;
|
||||
dump['CONST']['LOWERLEFT'] = world.LOWER_LEFT;
|
||||
@@ -122,7 +122,7 @@ directory.
|
||||
'mapType': True,
|
||||
'overlays': True,
|
||||
'coordsBox': True,
|
||||
'searchBox': True
|
||||
'searchBox': True # Lolwat. Obselete
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -219,6 +219,22 @@ def main():
|
||||
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, hovertext=result)
|
||||
elif type(result) == tuple:
|
||||
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result[1], hovertext=result[0])
|
||||
# Dict support to allow more flexible things in the future as well as polylines on the map.
|
||||
elif type(result) == dict:
|
||||
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result['text'])
|
||||
# Use custom hovertext if provided...
|
||||
if 'hovertext' in result and isinstance(result['hovertext'], basestring):
|
||||
d['hovertext'] = result['hovertext']
|
||||
else: # ...otherwise default to display text.
|
||||
d['hovertext'] = result['text']
|
||||
if 'polyline' in result and type(result['polyline']) == tuple: #if type(result.get('polyline', '')) == tuple:
|
||||
d['polyline'] = []
|
||||
for point in result['polyline']:
|
||||
# This poor man's validation code almost definately needs improving.
|
||||
if type(point) == dict:
|
||||
d['polyline'].append(dict(x=point['x'],y=point['y'],z=point['z']))
|
||||
if isinstance(result['color'], basestring):
|
||||
d['strokeColor'] = result['color']
|
||||
if "icon" in poi:
|
||||
d.update({"icon": poi['icon']})
|
||||
if "createInfoWindow" in poi:
|
||||
@@ -231,6 +247,22 @@ def main():
|
||||
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, hovertext=result)
|
||||
elif type(result) == tuple:
|
||||
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result[1], hovertext=result[0])
|
||||
# Dict support to allow more flexible things in the future as well as polylines on the map.
|
||||
elif type(result) == dict:
|
||||
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result['text'])
|
||||
# Use custom hovertext if provided...
|
||||
if 'hovertext' in result and isinstance(result['hovertext'], basestring):
|
||||
d['hovertext'] = result['hovertext']
|
||||
else: # ...otherwise default to display text.
|
||||
d['hovertext'] = result['text']
|
||||
if 'polyline' in result and type(result['polyline']) == tuple: #if type(result.get('polyline', '')) == tuple:
|
||||
d['polyline'] = []
|
||||
for point in result['polyline']:
|
||||
# This poor man's validation code almost definately needs improving.
|
||||
if type(point) == dict:
|
||||
d['polyline'].append(dict(x=point['x'],y=point['y'],z=point['z']))
|
||||
if isinstance(result['color'], basestring):
|
||||
d['strokeColor'] = result['color']
|
||||
if "icon" in poi:
|
||||
d.update({"icon": poi['icon']})
|
||||
if "createInfoWindow" in poi:
|
||||
@@ -243,6 +275,22 @@ def main():
|
||||
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result, hovertext=result)
|
||||
elif type(result) == tuple:
|
||||
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result[1], hovertext=result[0])
|
||||
# Dict support to allow more flexible things in the future as well as polylines on the map.
|
||||
elif type(result) == dict:
|
||||
d = dict(x=poi['x'], y=poi['y'], z=poi['z'], text=result['text'])
|
||||
# Use custom hovertext if provided...
|
||||
if 'hovertext' in result and isinstance(result['hovertext'], basestring):
|
||||
d['hovertext'] = result['hovertext']
|
||||
else: # ...otherwise default to display text.
|
||||
d['hovertext'] = result['text']
|
||||
if 'polyline' in result and type(result['polyline']) == tuple: #if type(result.get('polyline', '')) == tuple:
|
||||
d['polyline'] = []
|
||||
for point in result['polyline']:
|
||||
# This poor man's validation code almost definately needs improving.
|
||||
if type(point) == dict:
|
||||
d['polyline'].append(dict(x=point['x'],y=point['y'],z=point['z']))
|
||||
if isinstance(result['color'], basestring):
|
||||
d['strokeColor'] = result['color']
|
||||
if "icon" in poi:
|
||||
d.update({"icon": poi['icon']})
|
||||
if "createInfoWindow" in poi:
|
||||
|
||||
@@ -3,7 +3,9 @@ overviewer.util = {
|
||||
// vars for callback
|
||||
readyQueue: [],
|
||||
isReady: false,
|
||||
|
||||
|
||||
lastHash: null,
|
||||
|
||||
/* fuzz tester!
|
||||
*/
|
||||
'testMaths': function(t) {
|
||||
@@ -138,8 +140,9 @@ overviewer.util = {
|
||||
|
||||
overviewer.mapView.render();
|
||||
|
||||
// Jump to the hash if given
|
||||
// Jump to the hash if given (and do so for any further hash changes)
|
||||
overviewer.util.initHash();
|
||||
$(window).on('hashchange', function() { overviewer.util.initHash(); });
|
||||
|
||||
// create this control after initHash so it can correctly select the current world
|
||||
var worldSelector = new overviewer.views.WorldSelectorView({tagName:'DIV'});
|
||||
@@ -465,18 +468,23 @@ overviewer.util = {
|
||||
});
|
||||
},
|
||||
'initHash': function() {
|
||||
if(window.location.hash.split("/").length > 1) {
|
||||
overviewer.util.goToHash();
|
||||
// Clean up the hash.
|
||||
overviewer.util.updateHash();
|
||||
|
||||
var newHash = window.location.hash;
|
||||
if (overviewer.util.lastHash !== newHash) {
|
||||
overviewer.util.lastHash = newHash;
|
||||
if(newHash.split("/").length > 1) {
|
||||
overviewer.util.goToHash();
|
||||
// Clean up the hash.
|
||||
overviewer.util.updateHash();
|
||||
}
|
||||
}
|
||||
},
|
||||
'setHash': function(x, y, z, zoom, w, maptype) {
|
||||
// save this info is a nice easy to parse format
|
||||
var currentWorldView = overviewer.mapModel.get("currentWorldView");
|
||||
currentWorldView.options.lastViewport = [x,y,z,zoom];
|
||||
window.location.replace("#/" + Math.floor(x) + "/" + Math.floor(y) + "/" + Math.floor(z) + "/" + zoom + "/" + w + "/" + maptype);
|
||||
var newHash = "#/" + Math.floor(x) + "/" + Math.floor(y) + "/" + Math.floor(z) + "/" + zoom + "/" + w + "/" + maptype;
|
||||
overviewer.util.lastHash = newHash; // this should not trigger initHash
|
||||
window.location.replace(newHash);
|
||||
},
|
||||
'updateHash': function() {
|
||||
var currTileset = overviewer.mapView.options.currentTileSet;
|
||||
|
||||
@@ -474,6 +474,22 @@ overviewer.views.SignControlView = Backbone.View.extend({
|
||||
}
|
||||
}
|
||||
dataRoot[i].markerObjs.push(marker);
|
||||
// Polyline stuff added by FreakusGeekus. Probably needs work.
|
||||
if (typeof entity['polyline'] != 'undefined') {
|
||||
var polypath = new Array();
|
||||
for (point in entity.polyline) {
|
||||
polypath.push(overviewer.util.fromWorldToLatLng(entity.polyline[point].x, entity.polyline[point].y, entity.polyline[point].z, overviewer.mapView.options.currentTileSet));
|
||||
}
|
||||
|
||||
var polyline = new google.maps.Polyline({
|
||||
'path': polypath,
|
||||
'clickable': false,
|
||||
'map': overviewer.map,
|
||||
'visible': false,
|
||||
'strokeColor': entity['strokeColor']
|
||||
});
|
||||
dataRoot[i].markerObjs.push(polyline);
|
||||
}
|
||||
}
|
||||
dataRoot[i].created = true;
|
||||
}
|
||||
@@ -571,7 +587,7 @@ overviewer.views.LocationIconView = Backbone.View.extend({
|
||||
'icon': overviewerConfig.CONST.image.queryMarker,
|
||||
'visible': false
|
||||
});
|
||||
overviewer.collections.locationMarker.setVisible(true);
|
||||
overviewer.collections.locationMarker.setVisible(overviewer.mapView.options.currentTileSet.get("showlocationmarker"));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -199,7 +199,8 @@ class MCRFileReader(object):
|
||||
listing chunks contained in the file.
|
||||
"""
|
||||
|
||||
_table_format = struct.Struct(">1024I")
|
||||
_location_table_format = struct.Struct(">1024I")
|
||||
_timestamp_table_format = struct.Struct(">1024i")
|
||||
_chunk_header_format = struct.Struct(">I B")
|
||||
|
||||
def __init__(self, fileobj):
|
||||
@@ -217,8 +218,8 @@ class MCRFileReader(object):
|
||||
raise CorruptRegionError("invalid timestamp table")
|
||||
|
||||
# turn this data into a useful list
|
||||
self._locations = self._table_format.unpack(location_data)
|
||||
self._timestamps = self._table_format.unpack(timestamp_data)
|
||||
self._locations = self._location_table_format.unpack(location_data)
|
||||
self._timestamps = self._timestamp_table_format.unpack(timestamp_data)
|
||||
|
||||
def close(self):
|
||||
"""Close the region file and free any resources associated
|
||||
|
||||
@@ -83,10 +83,11 @@ renders = Setting(required=True, default=util.OrderedDict(),
|
||||
"overlay": Setting(required=False, validator=validateOverlays, default=[]),
|
||||
"showspawn": Setting(required=False, validator=validateBool, default=True),
|
||||
"base": Setting(required=False, validator=validateStr, default=""),
|
||||
"poititle": Setting(required=False, validator=validateStr, default="Signs"),
|
||||
"poititle": Setting(required=False, validator=validateStr, default="Markers"),
|
||||
"customwebassets": Setting(required=False, validator=validateWebAssetsPath, default=None),
|
||||
"maxzoom": Setting(required=False, validator=validateInt, default=None),
|
||||
"manualpois": Setting(required=False, validator=validateManualPOIs, default=[]),
|
||||
"showlocationmarker": Setting(required=False, validator=validateBool, default=True),
|
||||
# Remove this eventually (once people update their configs)
|
||||
"worldname": Setting(required=False, default=None,
|
||||
validator=error("The option 'worldname' is now called 'world'. Please update your config files")),
|
||||
|
||||
@@ -3159,7 +3159,7 @@ def stone_brick(self, blockid, data):
|
||||
return img
|
||||
|
||||
# huge brown and red mushroom
|
||||
@material(blockid=[99,100], data=range(11), solid=True)
|
||||
@material(blockid=[99,100], data= range(11) + [14,15], solid=True)
|
||||
def huge_mushroom(self, blockid, data):
|
||||
# rotation
|
||||
if self.rotation == 1:
|
||||
@@ -3232,6 +3232,12 @@ def huge_mushroom(self, blockid, data):
|
||||
if data == 10: # stem
|
||||
img = self.build_full_block(porous, None, None, stem, stem)
|
||||
|
||||
if data == 14: # all cap
|
||||
img = self.build_block(cap,cap)
|
||||
|
||||
if data == 15: # all stem
|
||||
img = self.build_block(stem,stem)
|
||||
|
||||
return img
|
||||
|
||||
# iron bars and glass pane
|
||||
|
||||
@@ -528,7 +528,8 @@ class TileSet(object):
|
||||
last_rendertime = self.max_chunk_mtime,
|
||||
imgextension = self.imgextension,
|
||||
isOverlay = isOverlay,
|
||||
poititle = self.options.get("poititle")
|
||||
poititle = self.options.get("poititle"),
|
||||
showlocationmarker = self.options.get("showlocationmarker")
|
||||
)
|
||||
|
||||
if isOverlay:
|
||||
|
||||
Reference in New Issue
Block a user