Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Collapse layergroup

4 REPLIES 4
Reply
Message 1 of 5
veillout
289 Views, 4 Replies

Collapse layergroup

Hi,
I just want to collapse all layer groups at the start application. I use this function in OnViewChanged() :
var map = GetMap();
var myLayerGroups = map.getMapLayerGroups();
for(var i=0; i < myLayerGroups.size(); i++)
{
var myLayerGroup = myLayerGroups.item(i);
myLayerGroup.collapse();
}

It works well but when I make zoom it collapses my group again...
How can I do to collapse just at start?
thanks for helps.
Yan
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: veillout

Use the onMapLoaded event instead.

Andy

wrote in message news:5619097@discussion.autodesk.com...
Hi,
I just want to collapse all layer groups at the start application. I use
this function in OnViewChanged() :
var map = GetMap();
var myLayerGroups = map.getMapLayerGroups();
for(var i=0; i < myLayerGroups.size(); i++)
{
var myLayerGroup = myLayerGroups.item(i);
myLayerGroup.collapse();
}

It works well but when I make zoom it collapses my group again...
How can I do to collapse just at start?
thanks for helps.
Yan
Message 3 of 5
veillout
in reply to: veillout

Thanks,
Have you got an example or a web site where I can find it?
Message 4 of 5
Anonymous
in reply to: veillout

There's information and examples in the API Help documentation. It looks
like you have your functionality coded correctly, but your question was to
how to execute it only when the map loads. In that case, use the
onMapLoaded event just like you are using onViewChanged. Keep in mind that
as the user moves around the map and the legend refreshes, the legened tries
to re-expand so you will probably have to use onViewChanged in addition.

Andy

wrote in message news:5625819@discussion.autodesk.com...
Thanks,
Have you got an example or a web site where I can find it?
Message 5 of 5
bjeffers
in reply to: veillout

Where would you put this code? In a PHP? legend.php? Message was edited by: bjeffers

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report