[mapguide-users] sql filters on map load

GordonL gordon.luckett at arrowgeomatics.com
Fri Oct 31 12:37:01 PDT 2014


Hi,
you will have to get the Layer definition and get its XML.

Modify the XML <filter> property
for example:
$xmlNode->nodeValue  = "ID_BLD_FLOOR=". $MYUID; 

Set the Resource as a new Layer, and add it to the map as a Session Layer:
for example:
$tempLayerResId = new MgResourceIdentifier("Session:" . $mgSessionId .
"//MyWalls.LayerDefinition");
$resourceService->SetResource($tempLayerResId,$byteSource->GetReader(),null); 


This is a classic application.  I have done a lot of Facilities Mapping
applications with MapGuide using this technique.  With both Oracle and SQL
Server as the data sources.  

You can store the Walls, Desks, Windows, Stairs and Carpets in separate
tables with the common columns such as FLOOR and BUILDING to filter the type
(Although sometimes I put all these in the same table).

This way you only need one map and a few layers to cover every building you
have to manage (even if you manage 1000s of buildings)

regards
Gordon






--
View this message in context: http://osgeo-org.1560.x6.nabble.com/sql-filters-on-map-load-tp5170576p5170685.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list