[mapguide-users] featurereader, tileservice, map.open() problem

Kenneth, GEOGRAF A/S ks at geograf.dk
Thu Mar 13 09:33:21 EDT 2008


I haven't used the official API for a while, because I made my own.
You can see how to do use it on this page:
http://code.google.com/p/mapstudioos/wiki/HowToUseMapGuideAPI

With that API you can use the following code:
MapGuideAPI.ServerConnectionI con = new HttpServerConnection(new 
Uri("http://localhost/mapguide/mapagent/mapagent.fcgi"), 
"Administrator", "admin", null);
MapGuideAPI.FeatureSetReader fsr = 
con.QueryFeatureSource("Library://sample.FeatureSource", "SDF_2:Schema", 
"ID=5 OR ID=7", new string[] { "ID", "GEOM" });
while(fsr.Read())
{
    MapGuideAPI.FeatureSetRow row =  fsr.Row;
    MapGuideAPI.Geometry geom = (MapGuideAPI.Geometry)fsr["GEOM"];
    int id = (int)fsr["ID"];
}


You should be able to find some similar code for the official API in the 
selection handler, supplied with the MapGuide viewer.

Regards, Kenneth, GEOGRAF A/S



Áron Deák skrev:
> Thank you for your quick reply, I am still stuck tough.
>
> What I really need is to be able to access the feature information on 
> the server without having to create a viewer.
>
> I couldn't find sample code that does this, please show me how I could 
> do this.
>
> Thanks in advance
>
> Aron Deak
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20080313/a73757c6/attachment.html


More information about the mapguide-users mailing list