Skip to content

Commit

Permalink
Add hidebydefault setting to playermarkers component too
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeprimm committed Aug 26, 2011
1 parent bc357dd commit f62d46c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/main/resources/configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions web/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion web/js/playermarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
};

0 comments on commit f62d46c

Please sign in to comment.