Intelligent landing page for AIMS/MapGuide Ajax viewer

本文介绍了一款基于.NET的智能地图视图器扩展功能,包括通过初始坐标及缩放级别加载指定视口的地图、通过过滤字符串实现地图上特征的查询与高亮显示以及在地图上展示过滤后的特征。

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值