主题:状态栏上显示地图中鼠标位置的经纬度?
procedure TForm1.Map1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); //显示当前经纬度
var
ScreenX: Single;
ScreenY: Single;
map_X: Double;
map_Y: Double;
begin
inherited;
ScreenX := X;
ScreenY := Y;
Map1.ConvertCoord(ScreenX, ScreenY, map_X, map_Y, miScreenToMap); //从屏幕坐标转换为mapx的地理坐标
StatusBar1.Panels[1].Text := '当前经纬度:X= ' + FloatToStr(map_X) + ' Y= '+FloatToStr(map_Y);
end;
以上是程序,已添加Panels[0]、Panels[1],为什么显示不了?
我是新手,请指点!谢谢
var
ScreenX: Single;
ScreenY: Single;
map_X: Double;
map_Y: Double;
begin
inherited;
ScreenX := X;
ScreenY := Y;
Map1.ConvertCoord(ScreenX, ScreenY, map_X, map_Y, miScreenToMap); //从屏幕坐标转换为mapx的地理坐标
StatusBar1.Panels[1].Text := '当前经纬度:X= ' + FloatToStr(map_X) + ' Y= '+FloatToStr(map_Y);
end;
以上是程序,已添加Panels[0]、Panels[1],为什么显示不了?
我是新手,请指点!谢谢