It works by taking a copy of the 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.

2. Query, zoom to and highlight by filter string. It accepts layer name, keyFieldID and id value, for following URL, map viewer zooms to the objects corresponding to “Autogenerated_SDF_ID in (1812,1813)” in the layer Parcels, highlighted if “highlight=1”.
<a href="http://localhost/MgViewerExtention/Default.aspx?Layer=Parcels&KeyField=Autogenerated_SDF_ID&ListId=1812,1813&highlight=1">http://localhost/MgViewerExtention/Default.aspx?Layer=Parcels&KeyField=Autogenerated_SDF_ID&ListId=1812,1813&highlight=1</a>
3. Filter features shown on map. You may have thousands even millions of features in a data source, but sometime you do not need to show all of them on map. With a filter string in URL, you can filter the features in MapGuide viewer when the viewer shows up. With following URL, I only show the parcels which Autogenerated_SDF_ID great than 1000:
<a href="http://adndevblog.typepad.com/files/mgviewerextention.zip">Download MgViewerExtention</a>
轉載請保留此資訊。
本文轉自峻祁連. Moving to Cloud/Mobile部落格園部落格,原文連結:http://www.cnblogs.com/junqilian/archive/2012/09/28/2707192.html,如需轉載請自行聯系原作者