111,129
社区成员
发帖
与我相关
我的任务
分享 private void mapBox1_MouseMove(GeoAPI.Geometries.Coordinate worldPos, MouseEventArgs imagePos)
{
PointF TemplatePos;//用于记录从地图坐标转换到桌面坐标的坐标
int x, y;
this.label1.Text = worldPos.X.ToString("N4") + "/" + worldPos.Y.ToString("N4");
this.label2.Text = imagePos.X.ToString("N4") + "/" + imagePos.Y.ToString("N4");
if (IsMousedowm)
{
TemplatePos = mapBox1.Map.WorldToImage(MouseoldPos);
x = (int)TemplatePos.X;
y = (int)TemplatePos.Y;
a.orgPointLable.X = x;
a.orgPointLable.Y = y;
a.Location = new Point(x, y);
mapBox1.Refresh();
}
}
private void mapBox1_MouseDown(GeoAPI.Geometries.Coordinate worldPos, MouseEventArgs imagePos)
{
float x, y;
x = a.orgPointLable.X;
y = a.orgPointLable.Y;
IsMousedowm = true;
MouseoldPos = mapBox1.Map.ImageToWorld(new PointF(x, y));
}