Add 'pinned' choice for showlayercontrol: setting - show expanded layer control

This commit is contained in:
Mike Primm 2011-12-31 08:26:55 +08:00 committed by mikeprimm
parent dc7efc2642
commit 514e96605b
2 changed files with 6 additions and 4 deletions

View File

@ -25,7 +25,7 @@ public class ClientConfigurationComponent extends Component {
s(t, "sidebaropened", c.getString("sidebaropened", "false"));
s(t, "dynmapversion", plugin.getDescription().getVersion());
s(t, "cyrillic", c.getBoolean("cyrillic-support", false));
s(t, "showlayercontrol", c.getBoolean("showlayercontrol", true));
s(t, "showlayercontrol", c.getString("showlayercontrol", "true"));
s(t, "grayplayerswhenhidden", c.getBoolean("grayplayerswhenhidden", true));
String sn = plugin.getServer().getServerName();
if(sn.equals("Unknown Server"))

View File

@ -109,8 +109,8 @@ DynMap.prototype = {
if(urlzoom != null)
me.options.defaultzoom = urlzoom;
var showlayerctl = me.getBoolParameterByName('showlayercontrol');
if(showlayerctl != null)
var showlayerctl = me.getParameterByName('showlayercontrol');
if(showlayerctl != "")
me.options.showlayercontrol = showlayerctl;
if(typeof me.options.defaultzoom == 'undefined')
@ -786,8 +786,10 @@ DynMap.prototype = {
addToLayerSelector: function(layer, name, priority) {
var me = this;
if(me.options.showlayercontrol && (!me.layercontrol)) {
if(me.options.showlayercontrol != "false" && (!me.layercontrol)) {
me.layercontrol = new DynmapLayerControl();
if(me.options.showlayercontrol == "pinned")
me.layercontrol.options.collapsed = false;
map.addControl(me.layercontrol);
}