[mapguide-users] Layer visibility control

James Card James.Card at calcad.com
Mon Jan 5 20:52:18 EST 2009


On Mon, 05 Jan 2009 17:13:16 -0800, irwan <anakando at yahoo.com> wrote:

> Hi.. i have 1 layer, contain 10 buildings that are not joinned with database. I need to know, how i can controlled the visibility of the certain building based on the database query?? For example, i have bl_id from A1 to A10. After query(database), i just want to show building from A2 to A6. I know this can be done with joining building layer with building table in database. But what i care most is performance. So it would be nice if i can controlled the visiblity of these building within the script or code.any idea or code sample?

I would run your database query and then use its results to modify the layer's Filter property. The code sample at <http://n2.nabble.com/Filtering-features-on-map-with-SelectFeatures-function-td1809656.html#a9818609> may help. Once you've modified the layer definition, you'll also need to update your map definition to use the new layer in the session repository, and then modify the layout definition to read your modified map definition. We do this in a couple of our maps and performance is good.

-- 
James Card
California CAD Solutions, Inc.
209-578-5580 - Voice
209-521-6493 - FAX


More information about the mapguide-users mailing list