Autodesk MapGuide Enterprise Developer
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
*nick
Loading layout and automatica lly running zoom script
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
132 Views, 2 Replies
01-19-2009 04:15 AM
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?
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?
*nick
Re: Loading layout and automatica lly running zoom script
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-20-2009 08:07 AM in reply to:
*nick
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?
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"
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?
Re: Loading layout and automatica lly running zoom script
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-22-2009 05:21 PM in reply to:
*nick
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/PH P/InitialMapView
- Jackie
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/PH
- Jackie
