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: 

Refresh problem in Viewer

1 REPLY 1
Reply
Message 1 of 2
Anonymous
558 Views, 1 Reply

Refresh problem in Viewer

We are having problem with toggeling the maps in a layout. Could someone help us on this?

Current Schenario -

We are developing an application in Asp.net which has a left menu in which a dropdown is present. Dropdown has name of different maps in it. When user selects a map in dropdown, the right section of page needs to display the same in Ajax viewer. The menu also has options for user to select which all layers need to be displayed on the selected map.

Current implementation -

We have a single layout and different maps. When user selects a map in dropdown - 1) We create copy of layers selected in user session and change. 2) Copy the map definition to user session 3) Change the layer definition paths to ones copies in session repository 4) Copy weblayout 5) Updates the weblayout with new map definition path 6) Passes the path of weblayut to ajax viewer.

Problem -

When we change the map names in dropdown, the above mentioned updates occur but the latest map doesnot get displayed in the viewer.

Could someone provide a solution to the same.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

I will beat around the bush and guess that the viewer is nuking the map when it loads. I ran into that issue when inserting a layer on the initial load for markers. This is what I hacked together, search for the map.Create and replace that line with this:
{code}
// you need to modify the viewer source in mapframe.aspx to try and open and existing map instead of just creating it
if(resourceSrvc.ResourceExists(new MgResourceIdentifier("Session:" + sessionId + "//" + mapName + "." + MgResourceType.Map)))
map.Open(resourceSrvc, mapName);
else
map.Create(resourceSrvc, resId, mapName);
{code}

You will need to call your own map.Create() (which I can assume you are doing since you are modifying the map/layers).

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

Post to forums  

Autodesk Design & Make Report