阅读:1412回复:1
用这段代码放大地图怎么不好使呢?
用这段代码放大地图怎么不好使呢?
var lyrs:IMoLayers; lyr:variant; ZoomOutRect,ARect:IMoRectangle; begin if CheckListBox_Layer.ItemIndex=-1 then begin ShowMessage('请选择图层!'); Exit; end; lyrs:=map1.Layers; lyr:=lyrs.item(CheckListBox_Layer.ItemIndex); if lyr.layertype=moMapLayer then begin if not lyr.visible then begin ShowMessage('请先显示该图层!'); Exit; end; ARect:=IMoRectangle(m_extentrect.Items[CheckListBox_Layer.ItemIndex]); if (ARect.Width=0)and(ARect.Height=0) then exit; ZoomOutRect:=Map1.Extent; ZoomOutRect.Left:=ARect.Left; ZoomOutRect.Top:=ARect.Top; ZoomOutRect.Bottom:=ARect.Bottom; ZoomOutRect.Right:=ARect.Right; Map1.FlashShape(ZoomOutRect,2); Map1.Extent:=ZoomOutRect; Map1.Refresh; end; end; |
|