Add 'hidebydefault' option for Markers layers

This commit is contained in:
Mike Primm 2011-09-07 11:22:44 -05:00
parent 21c68fa1b2
commit 89f63a9db2
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,6 +70,7 @@ 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;
if(!configuration.hidebydefault)
dynmap.map.addLayer(set.layergroup); dynmap.map.addLayer(set.layergroup);
dynmap.layercontrol.addOverlay(set.layergroup, set.label); dynmap.layercontrol.addOverlay(set.layergroup, set.label);
} }