[mapserver-users] Highlighting query results

shurhen shurhenv at mail.ru
Tue Sep 2 07:14:38 PDT 2008


Hi!

I'm newbie in mapserver :) 

I need to highlight query results. I wanna select object by attribute and then highlight it. But I've not found any information how can I do this. Most of GIS have possibility to highlight selected objects, therefore I suppose  what MapServer has this ability too. "Selected" means to highlight object when I click at it, and to return to its previous color when I click at another object. 
I've found similar question

http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0309/msg00063.html

but unfortunately it remains without any answer :(

If there is no way except to color selected object manually, please help me to do this too.

Here is Mapscript code example based on the info what I found on this site:

a_layer.queryByAttributes(m_map, null, a_query, 1);
            using (resultCacheObj results = a_layer.getResults())
            {
                if (results != null && results.numresults > 0)
                {
                    a_layer.open();
                    for(int i = 0; i < results.numresults; i++)
                    {
                        resultCacheMemberObj a_result = results.getResult(i);
                        shapeObj a_obj = a_layer.getFeature(a_result.shapeindex, a_result.tileindex);                       


                        //           WHAT NEXT??


                    }
                    a_layer.close();
                }
            }

PS Sorry for my English, but I hope you've understood me





More information about the MapServer-users mailing list