[mapserver-users] polygon fill

Schylberg Lars lars.schylberg at saabgroup.com
Wed Mar 18 04:23:14 PDT 2015


Hi,

Without looking at the your details I remember one blog entry that might help.

http://linfiniti.com/2011/09/making-the-most-of-umn-mapserver-runtime-variable-substitution/

another relevant link seems to be

http://trac.osgeo.org/openlayers/wiki/Highlighting

/Lars

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of rishi
Sent: den 16 mars 2015 10:54
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] polygon fill

hi all

iam trying to highlight the villages based on query

but only one polygon is highlighting
the query is based on the area of the villages, when user enters area <=********** ,it is displaying 13 villages in the grid and also same time it has to highlight the villages on the map
my code is

aspx page

 protected void btnselect_Click(object sender, EventArgs e)
    {

        string query = "";

        query = String.Format(" select gid,box(geom),villname,geom,area(geom) from villages where area(geom) " + ddlsymb.SelectedValue + "  " + txtarea.Text + " ");

        dt = MyClass.getData(query);

        if (dt == null || dt.Rows.Count == 0)
        {
            Response.Write("No record found, Try Zoom in and click close to feature.");
        }
        else
        {
            dr = dt.Rows[0];
            //String selectedGID = dr["gid"].ToString();

            //gid = selectedGID;
            var layername = "villages";

            for(int i=0;i<dt.Rows.Count;i++)
{
 dr = dt.Rows[i];
 String selectedGID = dr["gid"].ToString();

 gid = selectedGID;
            Response.Write(String.Format(@"<script>window.parent.highlightnav('{0}','{1}');</script>", gid, layername));
            //Locate(query);
    }

            if (dt.Columns.Contains("gid"))
            {
                dt.Columns.Remove("gid");
            }
            if (dt.Columns.Contains("geom"))
            {
                dt.Columns.Remove("geom");
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
    }


js page

function highlightnav(gid,layername)
{

    bPoint.params.gid = gid;
    bPoint.params.tbl = layername;
    //bPoint.params.getElementById = geom;
    bPoint.redraw();
}


mapfile bpoint.map

MAP
  EXTENT 8240841.450745 2400319.900386 9218007.463612 3107183.406947
  TRANSPARENT on
  IMAGETYPE png
  SIZE 450 500
  SYMBOLSET "symbols.txt"


            web
                        metadata
                                    wms_srs "EPSG:4326 EPSG:900913"
                        end
            end



  LAYER
            CONNECTIONTYPE postgis
            CONNECTION "user=postgres password=****** dbname=mpdb port=5432"
            DATA "geom FROM (select geom,gid from %tbl% where gid=%gid%)as foo using srid=900913 using unique gid"

            STATUS Default
            TYPE point

            PROJECTION
          "init=epsg:900913"
        END


            class
                        style

                                    symbol 'line20'
                                    color 255 0 0
                                    size 10
                        end
            end
    END
END


i created for loop, to highlight all the polygons, but it is highlighting only one polygon.
 plz tell me the code





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150318/f04edb97/attachment.htm>


More information about the MapServer-users mailing list