Add 'hidebydefault' option for Markers layers

This commit is contained in:
Mike Primm 2011-09-08 00:22:44 +08:00 committed by mikeprimm
parent 771059bf5a
commit 9da159f842
2 changed files with 146 additions and 143 deletions

View File

@ -47,6 +47,8 @@ components:
#showlabel: true
# If set, enables support for using signs for markers
#enablesigns: true
# If set, make markers layer hidden by default
#hidebydefault: true
- class: org.dynmap.ClientComponent
type: chat

View File

@ -70,6 +70,7 @@ componentconstructors['markers'] = function(dynmap, configuration) {
function createMarkerSet(set, ts) {
set.layergroup = new L.LayerGroup();
set.timestamp = ts;
if(!configuration.hidebydefault)
dynmap.map.addLayer(set.layergroup);
dynmap.layercontrol.addOverlay(set.layergroup, set.label);
}