Se afișează postările cu eticheta DotSpatial. Afișați toate postările
Se afișează postările cu eticheta DotSpatial. Afișați toate postările

luni, 25 august 2014

Identify feature DotSpatial Map

Map

Identify feature DotSpatial Map on MouseUP event.


private void map1_MouseUp(object sender, MouseEventArgs e)
{
      Coordinate cor =  map1.PixelToProj(e.Location);
      Extent ex = new Extent(cor.X, cor.Y, cor.X, cor.Y);
      var  mLayer = map1.Layers[0];
      IFeatureLayer il = (IFeatureLayer) mLayer;
      List<IFeature> result = il.DataSet.Select(ex);
      if (result.Count>0)  
      {
           IFeature ift = result.FirstOrDefault();
           MessageBox.Show(ift.DataRow[0].ToString()); 
       }
}