During the project process, you may encounter the following situation: a data source contains hundreds of thousands or millions of data records, but the actual display on the map does not need to be all displayed, it is too slow to display all the information. Is there a way to dynamically set the filter? Of course, as a WebGIS platform, MapGuide certainly has a large number of online users. The filter must be applied only to the current user. Otherwise, a person may not be able to see what others want, isn't it a big mess ?!
Given that this problem is a common requirement, I used E to describe the implementation principles and processes in detail, along with the complete implementation code, and published it on ADN DevBlog, you can go there.
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 & gt; 10000
If you save the changes and click "refresh" button in layer preview, you will notice that the layer is filtered.
...
Click here to view the full text:
Http://adndevblog.typepad.com/infrastructure/2012/04/set-filter-for-layer-at-runtime-in-autodesk-infrastructure-map-server-or-mapguide-open-source.html