[mapserver-users] Re: Highlighting symbols dynamically on a point layer using C# mapscript
sireesha
sireesha_alloori at satyam.com
Wed Feb 24 05:07:53 PST 2010
Thank you Tamas for the reply.
I am not able to view the selected data with different symbol.
i created a new layer
layerObj layer = new layerObj(map);
layer.name = "test";
layer.type = MS_LAYER_TYPE.MS_LAYER_POINT;
layer.status = mapscript.MS_TRUE;
classObj clsobj = new classObj(layer);
styleObj styobj = new styleObj(clsobj);
styobj.setSymbolByName(map, "circle");
styobj.size = 20;
styobj.color.setRGB(255, 50, 0);
styobj.outlinecolor.setRGB(0, 0, 0);
Now to add the selected point data to the layer i wrote the code mentioned
below:But i am not able to view the points in different symbols.
foreach (DataRow dr in dtVillages.Rows)
{
string villCode = dr["VILLAGE_CODE"].ToString().Trim();
cmd.CommandText = "select x(the_geom),y(the_geom) from villages_fdhs WHERE
vlg_code ='" + villCode + "'";
pointObj point = new pointObj(0, 0, 0, 0);
double x_coor, y_coor;
Npgsql.NpgsqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
x_coor =
Double.Parse(rdr.GetValue(0).ToString().Trim());
y_coor =
Double.Parse(rdr.GetValue(1).ToString().Trim());
point.setXY(x_coor, y_coor, 0);
image = map.draw();
layer = map.getLayerByName("test");
layer.status = mapscript.MS_ON;
point.draw(map, layer, img, 0, "abc");
map.draw();
}
}
Please help me where i am going wrong.
--
View this message in context: http://n2.nabble.com/Highlighting-symbols-dynamically-on-a-point-layer-using-C-mapscript-tp4617293p4625575.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
More information about the MapServer-users
mailing list