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: 

Loading layout and automatically running zoom script

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
340 Views, 2 Replies

Loading layout and automatically running zoom script

I want to load a layout, and automatically zoom to a point on the layout.
If the script is set as a home task, it runs automatically the first time,
but not the second, as if it doesn't run if already in the browser cache.
If the script is loaded in the script frame, it only runs from a button
press, not automatically.
I have also tried modifying the ajaxviewer.aspx and mainframe.aspx to insert
string url = "
target=\"scriptFrame\">
";

Response.Write(url);

after the frameset is loaded.

It is still not zooming automatically, where am I going wrong?
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

There must be a way of setting the initial map center and zoom scale when
opening the map frame
It doesn't seem logical to open the map as set in the MapGuide Studio, then
zooming to the required point.



"nick" wrote in message
news:6107142@discussion.autodesk.com...
I want to load a layout, and automatically zoom to a point on the layout.
If the script is set as a home task, it runs automatically the first time,
but not the second, as if it doesn't run if already in the browser cache.
If the script is loaded in the script frame, it only runs from a button
press, not automatically.
I have also tried modifying the ajaxviewer.aspx and mainframe.aspx to insert
string url = " target=\"scriptFrame\"> ";

Response.Write(url);

after the frameset is loaded.

It is still not zooming automatically, where am I going wrong?
Message 3 of 3
jackie.ng
in reply to: Anonymous

In the WebLayout, there are settings for controlling the initial view and scale.

What you can do is before you actually load the viewer to do the following:

1. Get the XML content of the WebLayout you want to load
2. Modify the XML content. Set the initial view and scale to the values you want.
3. Save the XML content into a temporary WebLayout (use the session repository)
4. Load your viewer, passing in the resource ID of the WebLayout for your WEBLAYOUT parameter

There's a PHP example here which can easily be converted to the language of your choice:

http://trac.osgeo.org/mapguide/wiki/CodeSamples/PHP/InitialMapView

- Jackie

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

Post to forums  

Autodesk Design & Make Report