通过编程实现要素在图层上的动态过滤

大家在项目过程中也许会遇到下面的情况,一个数据源中有几十万、上百万的数据,而实际显示在地图上确并不需要全部显示,而且全部显示的话也太慢了,有没有一中办法来动态设置过滤器呢?当然MapGuide作为一个WebGIS平台,同时在线的用户肯定很多,必须实现过滤器只适用于当前用户,否则一个人设个条件,其他人想看的也看不到了,岂不是天下大乱?!

鉴于这个问题是个很常见的需求,我用E文详细描述的其实现的原理和过程,并附有完整的实现代码,发表在ADN DevBlog上,大家可以到那边去看。

 

Set filter for layer at runtime in Autodesk Infrastructure Map Server or MapGuide Enterprise

When developing application on Autodesk Infrastructure Map Server, you may want to apply a filter to a layer to hide some features. In this post, I will demonstrate how to do this programmatically.

How to do in Infrastructure Studio UI

Firstly, let’s take a look how we can do the same using Infrastructure Studio UI. Open the layer in Infrastructure Studio, you will notice that you can set filter for layer by setting “Filter applied to data”, click the “…” button to open the expression editor, which helps you create filter string more easier. In this case, I set a filter for parcels layer:

Autogenerated_SDF_ID  > 10000

image

If you save the changes and click “refresh” button in layer preview, you will notice that the layer is filtered.

 

点击这里查看全文:

http://adndevblog.typepad.com/infrastructure/2012/04/set-filter-for-layer-at-runtime-in-autodesk-infrastructure-map-server-or-mapguide-open-source.html

你可能感兴趣的:(编程)