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: 

Dynamic Add Layer Resource, initial visibility setting and drawing order Issue

2 REPLIES 2
Reply
Message 1 of 3
swimming123
837 Views, 2 Replies

Dynamic Add Layer Resource, initial visibility setting and drawing order Issue

In order to add a raster image to the map at the bottom dynamically, I use the different choices.

 

First I add this layer to the bottom layer group (I have Base layer Group), I found the default is always On which is not I want it to be. AIMS studio, Maestro or setting in xml like below (Visible: false) cannot make it NOT display at initial view.

                                             <BaseMapLayerGroup>
                                                    <Name>Raster Image</Name>
                                                    <Visible>false</Visible>

 

Second I use MgResourceService, MgResourceIdentifier to point to the Resource ID (similar like

    MgResourceIdentifier resourceID = new MgResourceIdentifier("Library://ABCs/AB/Layers/DataOnImage/orthoPhoto.LayerDefinition"); then programmingly add the new layer to exsiting map. It worked but there are 2 big issue: first the new layer is always on the top no matter how I set the Index ( suppose we have 100 layers, then I can set index = 100, or -1 which is not valid, 100000 is not valid); second issue is it is very slow to render this new layer even I use newLayer.ForceRefresh() and Javascript to call fusion Refresh the Map method. It will show until I pan the map a little bit.

 

Any suggestion and quick fix for this problem? Thank you.

 

 

2 REPLIES 2
Message 2 of 3
swimming123
in reply to: swimming123

The easy way to do this job is set the group layers invisible if possible, then toggle the group on or off. But if I put the layers inside the Base Layers, there's no option to set layers visible or invisible. This is the reason that Base Layers Group will always visible in the map at initial view.

 

The other choice is dynamically set the visibility scale. For example, in Maestro/Studio we set it always invisible, when we want it visible, we change the visibility scale, popup a textbox to accept the scale to be visibility. But I am not sure if the API will allow me to do that.

Message 3 of 3
swimming123
in reply to: swimming123

This can be resolved by modifying fusionSF.js from line 8781 to 8791 and set its visibility to false, then compressor the file again.

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

Post to forums  

Autodesk Design & Make Report