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 207ef79ce1
commit a5cf76c983
2 changed files with 146 additions and 143 deletions

View file

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

View file

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