mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-01 06:33:38 +01:00
Add hidebydefault setting to playermarkers component too
This commit is contained in:
parent
ace7fbf838
commit
3d385106e9
@ -55,6 +55,8 @@ components:
|
||||
showplayerhealth: true
|
||||
# Option to make player faces small - don't use with showplayerhealth
|
||||
smallplayerfaces: false
|
||||
# # Optional - make player faces layer hidden by default
|
||||
# hidebydefault: true
|
||||
#- class: org.dynmap.ClientComponent
|
||||
# type: digitalclock
|
||||
- class: org.dynmap.ClientComponent
|
||||
|
@ -284,13 +284,15 @@ DynMap.prototype = {
|
||||
|
||||
me.selectMap(me.defaultworld.defaultmap);
|
||||
|
||||
var componentstoload = 0;
|
||||
var configset = { };
|
||||
$.each(me.options.components, function(index, configuration) {
|
||||
if(!configset[configuration.type])
|
||||
if(!configset[configuration.type]) {
|
||||
configset[configuration.type] = [];
|
||||
componentstoload++;
|
||||
}
|
||||
configset[configuration.type].push(configuration);
|
||||
});
|
||||
var componentstoload = configset.length;
|
||||
|
||||
$.each(configset, function(type, configlist) {
|
||||
loadjs('js/' + type + '.js', function() {
|
||||
|
@ -128,6 +128,7 @@ componentconstructors['playermarkers'] = function(dynmap, configuration) {
|
||||
}
|
||||
});
|
||||
dynmap.playermarkergroup = new L.LayerGroup();
|
||||
dynmap.map.addLayer(dynmap.playermarkergroup);
|
||||
if(!configuration.hidebydefault)
|
||||
dynmap.map.addLayer(dynmap.playermarkergroup);
|
||||
dynmap.layercontrol.addOverlay(dynmap.playermarkergroup, 'Players');
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user