Intelligent landing page for AIMS/MapGuide Ajax viewer

简介:


By Daniel Du

You may come across the InitialMapView sample page in php, It expects the values to be passed to the script as query string parameters, and zoom to specified view port when loading the map. Here is an intelligent landing page MapGuide Viewer in .NET, and with more extended functionalities.

 

1. Zoom to specified view port by initial x, y and scale, the URL is expected as below: http://serverName/MgViewerExtention/Default.aspx?X=-87.723233&Y=43.754561&scale=5000 
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.

image

 

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”.

http://localhost/MgViewerExtention/Default.aspx?Layer=Parcels&KeyField=Autogenerated_SDF_ID&ListId=1812,1813&highlight=1

image

 

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:

http://localhost/MgViewerExtention/Default.aspx?Layer=Parcels&layerfilter=Autogenerated_SDF_ID > 10000

image

 

The sample project can be downloaded here, it is based on AIMS 2013, but it could be easy to apply it to other version of AIMS/MapGuide. If you are interested in how it is implemented in detail, please download and read the code. Hope it helps.

Download MgViewerExtention

作者: 峻祁连
邮箱:junqilian@163.com 
出处: http://junqilian.cnblogs.com 
转载请保留此信息。





本文转自峻祁连. Moving to Cloud/Mobile博客园博客,原文链接:http://www.cnblogs.com/junqilian/archive/2012/09/28/2707192.html ,如需转载请自行联系原作者
相关文章
|
XML 前端开发 JavaScript
什么是Ajax和jquery
什么是Ajax和jquery
295 0
|
JSON 前端开发 Java
利用Spring Boot处理JSON数据实战(包括jQuery,html,ajax)附源码 超详细
利用Spring Boot处理JSON数据实战(包括jQuery,html,ajax)附源码 超详细
784 0
|
敏捷开发 JavaScript 前端开发
❤❤❤【Vue.js最新版】sd.js基于jQuery Ajax最新原生完整版for凯哥API版本❤❤❤
❤❤❤【Vue.js最新版】sd.js基于jQuery Ajax最新原生完整版for凯哥API版本❤❤❤
|
XML JSON JavaScript
JQuery基础和原生ajax
JQuery基础和原生ajax
307 3
|
前端开发 JavaScript
Jquery ajax捕获错误信息
Jquery ajax捕获错误信息
290 0
|
JSON 缓存 前端开发
Jquery中AJAX的应用
Jquery中AJAX的应用
286 0
|
JSON 前端开发 JavaScript
jQuery中ajax的使用
jQuery中ajax的使用