Add 'hidebydefault' option for Markers layers
This commit is contained in:
parent
207ef79ce1
commit
a5cf76c983
2 changed files with 146 additions and 143 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue