Getting Leaflet.Control.Layer.Tree 'children's' to collapse by default? The Next CEO of Stack OverflowLeaflet and EPSG 4326 ProjectionsHow to draw ploygon in leaflet that use event?leaflet-omnivore style functionleaflet: how to show draw control in custom (own) div?How to add WMS legend in leaflet from Geoserver?Is it possible to have a Leaflet control with large images / icons“Navigator.pointerEnabled. It will be removed in near future.” Leaflet warningLeaflet v1 plugin: layer control for ungrouped, grouped, and nested-grouped layersChanging size of globe in Leaflet globe mini map?What does the default crs being EPSG:3857 in Leaflet mean?
How do you know when two objects are so called entangled?
Unreliable Magic - Is it worth it?
Reducing Exact Cover to Subset Sum in practise!
Extending anchors in TikZ
How to make a variable always equal to the result of some calculations?
Opposite of a diet
If/When UK leaves the EU, can a future goverment do a referendum to join EU
What do "high sea" and "carry" mean in this sentence?
If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?
Reduce array of object to totals by property object
How do I construct this japanese bowl?
What can we do to stop prior company from asking us questions?
Why do we use the plural of movies in this phrase "We went to the movies last night."?
At which OSI layer a user-generated data resides?
Do I need to enable Dev Hub in my PROD Org?
Complex fractions
Rotate a column
Disadvantage of gaining multiple levels at once in a short milestone-XP game
Anatomically Correct Strange Women In Ponds Distributing Swords
What exact does MIB represent in SNMP? How is it different from OID?
Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?
Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?
Is it ever safe to open a suspicious html file (e.g. email attachment)?
What was the first Unix version to run on a microcomputer?
Getting Leaflet.Control.Layer.Tree 'children's' to collapse by default?
The Next CEO of Stack OverflowLeaflet and EPSG 4326 ProjectionsHow to draw ploygon in leaflet that use event?leaflet-omnivore style functionleaflet: how to show draw control in custom (own) div?How to add WMS legend in leaflet from Geoserver?Is it possible to have a Leaflet control with large images / icons“Navigator.pointerEnabled. It will be removed in near future.” Leaflet warningLeaflet v1 plugin: layer control for ungrouped, grouped, and nested-grouped layersChanging size of globe in Leaflet globe mini map?What does the default crs being EPSG:3857 in Leaflet mean?
I am using the Leaflet layer.control.tree plugin from here : https://github.com/jjimenezshaw/Leaflet.Control.Layers.Tree
But I can't figure out how to collapse the branch by default. Now it looks like this:
does anybody know how to close the branch by default?
I do not mean the whole layer control that collapses by default I mean the tap where it says '' Warrior ''
leaflet
add a comment |
I am using the Leaflet layer.control.tree plugin from here : https://github.com/jjimenezshaw/Leaflet.Control.Layers.Tree
But I can't figure out how to collapse the branch by default. Now it looks like this:
does anybody know how to close the branch by default?
I do not mean the whole layer control that collapses by default I mean the tap where it says '' Warrior ''
leaflet
add a comment |
I am using the Leaflet layer.control.tree plugin from here : https://github.com/jjimenezshaw/Leaflet.Control.Layers.Tree
But I can't figure out how to collapse the branch by default. Now it looks like this:
does anybody know how to close the branch by default?
I do not mean the whole layer control that collapses by default I mean the tap where it says '' Warrior ''
leaflet
I am using the Leaflet layer.control.tree plugin from here : https://github.com/jjimenezshaw/Leaflet.Control.Layers.Tree
But I can't figure out how to collapse the branch by default. Now it looks like this:
does anybody know how to close the branch by default?
I do not mean the whole layer control that collapses by default I mean the tap where it says '' Warrior ''
leaflet
leaflet
edited 18 hours ago
PolyGeo♦
53.8k1781245
53.8k1781245
asked yesterday


Cas JulicherCas Julicher
205
205
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
For the branch you want to be initially collapsed, use collapsed: true
option. This option is inherited from L.control.layers
.
You can see use of this option in Airports demo of Leaflet.Control.Layers.Tree
plugin: https://jjimenezshaw.github.io/Leaflet.Control.Layers.Tree/examples/airports.html
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f316989%2fgetting-leaflet-control-layer-tree-childrens-to-collapse-by-default%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
For the branch you want to be initially collapsed, use collapsed: true
option. This option is inherited from L.control.layers
.
You can see use of this option in Airports demo of Leaflet.Control.Layers.Tree
plugin: https://jjimenezshaw.github.io/Leaflet.Control.Layers.Tree/examples/airports.html
add a comment |
For the branch you want to be initially collapsed, use collapsed: true
option. This option is inherited from L.control.layers
.
You can see use of this option in Airports demo of Leaflet.Control.Layers.Tree
plugin: https://jjimenezshaw.github.io/Leaflet.Control.Layers.Tree/examples/airports.html
add a comment |
For the branch you want to be initially collapsed, use collapsed: true
option. This option is inherited from L.control.layers
.
You can see use of this option in Airports demo of Leaflet.Control.Layers.Tree
plugin: https://jjimenezshaw.github.io/Leaflet.Control.Layers.Tree/examples/airports.html
For the branch you want to be initially collapsed, use collapsed: true
option. This option is inherited from L.control.layers
.
You can see use of this option in Airports demo of Leaflet.Control.Layers.Tree
plugin: https://jjimenezshaw.github.io/Leaflet.Control.Layers.Tree/examples/airports.html
answered 21 hours ago


TomazicMTomazicM
1,3951216
1,3951216
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f316989%2fgetting-leaflet-control-layer-tree-childrens-to-collapse-by-default%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown