By Daniel Du
You may come across this post, implementing an intelligent landing page in AIMS/MapGuide Ajax viewer(Basic web layout), and I am also asked how to do it in Fusion viewer(flexible web layout). Actually the implemenation is pretty similar, as both Ajax Viewer and Fusion viewer share the same server side logic. Let’s take the first one as an example,zooming to specified view port by initial x, y and scale. If you have not read this post and the source code of the sample attached, please do it now, then come back to this one.
In the implementation of zooming to specified view port, it takes a copy of the basic WebLayout stored in the Library repository and changing the <CenterX/>, <CenterY/> and <Scale/> elements. The updated XML is written into the Session and is used as the target when the page is ultimately loaded. In fusion web layout, there are similar tags if you “use custom view”:
Let’s examine the xml of fusion weblayout with mapagent(http://localhost/mapserver2014/mapagent/), select resource –> GetResource Content
You will see the InitialView tag, which is similar with basic web layout. OK, with that, you can do the similar within basic weblayout, taking a copy of theflexible WebLayout stored in the Library repository and changing the <CenterX/>, <CenterY/> and <Scale/> elements. The updated XML is written into the Session and is used as the target when the page is ultimately loaded. Please refer to the source code in this post for detail.
Good luck!