[mapguide-users] RE: Simple Query. How to.
Chris Gountanis
cgountanis at mpower-tech.com
Mon Feb 12 12:48:12 EST 2007
The examples on the OSGEO site have ASP.NET examples and they are all in C#.
-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org on behalf of MaciekS
Sent: Mon 2/12/2007 9:31 AM
To: mapguide-users at lists.osgeo.org
Cc:
Subject: [mapguide-users] RE: Simple Query. How to.
Willem, thank you for fast reply.
Did you or anybody saw any examples in C#?
Maciek
Willem Schwarte wrote:
>
> You can create a layer in studio as how it should look, and save this as
> a XML file (menu File).
>
> Then you can load this XML as a new layer in your code and set the
> FILTER (id=1 or whatever) add the layer to your map and refresh (or
> not).
>
> This is how I do this. There is an example on the example site on
> osgeo.org.
>
> Something like this:
>
> // Change the filter
> $xpath = new DOMXPath($domDocument);
>
> $query = '//Filter';
> // Get a list of all the <AreaRule><Filter> elements in
> // the XML.
> $nodes = $xpath->query($query);
>
> // Find the correct node and change it , this is the filter
> foreach ($nodes as $node )
> {
> $node->nodeValue = '"afz_nr" = '.$_GET['afznr'].'';
> }
>
>
> // Add the layer to the map
> $layerDefinition = $domDocument->saveXML();
>
> $newLayer = add_layer_definition_to_map($layerDefinition,
> "newlayer", "Route", $sessionId, $resourceService, $map,0);
>
>
> Willem
>
>
>
> -----Oorspronkelijk bericht-----
> Van: mapguide-users-bounces at lists.osgeo.org
> [mailto:mapguide-users-bounces at lists.osgeo.org] Namens MaciekS
> Verzonden: maandag 12 februari 2007 15:33
> Aan: mapguide-users at lists.osgeo.org
> Onderwerp: [mapguide-users] Simple Query. How to.
>
>
> Hi MapGuide developers.
>
> Does somebody know how to filter data on specified, existing layer?
>
> I added a layer from a SHP file to my repository using MapGuide Studio.
> Now I'd like to filter this layer from my code with a simple query, for
> example (where ID=1).
> How should I built my code to execute the query that finally will
> display in
> the browser only polygons specified in the query?
>
> Regards, Maciek
>
> --
> View this message in context:
> http://www.nabble.com/Simple-Query.-How-to.-tf3214017s16610.html#a892519
> 4
> Sent from the MapGuide Users mailing list archive at Nabble.com.
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>
--
View this message in context: http://www.nabble.com/Simple-Query.-How-to.-tf3214017s16610.html#a8926385
Sent from the MapGuide Users mailing list archive at Nabble.com.
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 7706 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapguide-users/attachments/20070212/0479915d/attachment.bin
More information about the mapguide-users
mailing list