Add a minzoom option
This only affects what's written to overviewerConfig.js. That is, it does not change the amount of tiles rendered (it's exactly analogous to maxzom) Closes #994
This commit is contained in:
@@ -540,6 +540,18 @@ values. The valid configuration keys are listed below.
|
||||
|
||||
**Default:** Automatically set to most detailed zoom level
|
||||
|
||||
``minzoom``
|
||||
This specifies the minimum zoom allowed by the zoom control on the web page. For
|
||||
example, setting this to 2 will disable the two most-zoomed out levels.
|
||||
|
||||
.. note::
|
||||
|
||||
This does not change the number of zoom levels rendered, but allows
|
||||
you to have control over the number of zoom levels accessible via the
|
||||
slider control.
|
||||
|
||||
**Default:** 0 (zero, which does not disable any zoom levels)
|
||||
|
||||
``showlocationmarker``
|
||||
Allows you to specify whether to show the location marker when accessing a URL
|
||||
with coordinates specified.
|
||||
|
||||
@@ -479,7 +479,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", "showlocationmarker"])
|
||||
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", "minzoom"])
|
||||
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)
|
||||
|
||||
@@ -86,6 +86,7 @@ renders = Setting(required=True, default=util.OrderedDict(),
|
||||
"poititle": Setting(required=False, validator=validateStr, default="Markers"),
|
||||
"customwebassets": Setting(required=False, validator=validateWebAssetsPath, default=None),
|
||||
"maxzoom": Setting(required=False, validator=validateInt, default=None),
|
||||
"minzoom": Setting(required=False, validator=validateInt, default=0),
|
||||
"manualpois": Setting(required=False, validator=validateManualPOIs, default=[]),
|
||||
"showlocationmarker": Setting(required=False, validator=validateBool, default=True),
|
||||
# Remove this eventually (once people update their configs)
|
||||
|
||||
@@ -517,7 +517,6 @@ class TileSet(object):
|
||||
|
||||
d = dict(name = self.options.get('title'),
|
||||
zoomLevels = self.treedepth,
|
||||
minZoom = 0,
|
||||
defaultZoom = self.options.get('defaultzoom'),
|
||||
maxZoom = self.options.get('maxzoom', self.treedepth) if self.options.get('maxzoom', self.treedepth) >= 0 else self.treedepth+self.options.get('maxzoom'),
|
||||
path = self.options.get('name'),
|
||||
@@ -531,6 +530,7 @@ class TileSet(object):
|
||||
poititle = self.options.get("poititle"),
|
||||
showlocationmarker = self.options.get("showlocationmarker")
|
||||
)
|
||||
d['minZoom'] = min(max(0, self.options.get("minzoom", 0)), d['maxZoom'])
|
||||
|
||||
if isOverlay:
|
||||
d.update({"tilesets": self.options.get("overlay")})
|
||||
|
||||
Reference in New Issue
Block a user