阅读:1657回复:5
请问在MO中如何查询定位一个点对象,这样只能定位大的对象
<P>这样只能定位大的对象,我现在要查询的图层 是由点对象组成的 不能用这种方式定位他们 请问 我该怎么做 谢谢</P>
<P> recs := layer.SearchExpression(exp);</P> <P> // show the results, if any<BR> if (not recs.EOF) then<BR> begin<BR> fields := recs.Fields;<BR> shp := IMoPolygon(CreateOleObject('MapObjects2.Polygon'));<BR> // get the shape geometry<BR> shp := IMoPolygon(IDispatch(fields.Item('Shape').Value));<BR> // create a rectangle based on the extent of the state<BR> rect:= IMoRectangle(CreateOleObject('MapObjects2.Rectangle'));<BR> rect:= shp.Extent;<BR> rect.ScaleRectangle((2.0));<BR> Form1.Map1.Extent := rect;<BR> Form1.Map1.Refresh;</P> |
|
1楼#
发布于:2005-06-16 15:40
<P>我就是想问一个 查询定位点(point)对象的方法 谢谢了</P>
<P>最好是delphi的 有没有人能给我解答一下呢</P> <P>??</P> |
|
2楼#
发布于:2005-06-29 01:06
<P>up</P>
<P>up</P> <P>up</P> |
|
3楼#
发布于:2005-06-29 20:20
'定位闪烁显示<br><br> Dim rect As MapObjects2.Rectangle<br> Select Case Recs.Fields("shape").Type<br> Case moPoint<br> Dim MapX As Double, MapY As Double<br> Mapx = ID_Recs.Fields("shape").value.X<br> MapY = ID_Recs.Fields("shape").value.Y<br> myMap.CenterAt MapX, MapY<br> Set rect = myMap.Extent<br> Do While rect.Width > 50<br> rect.ScaleRectangle 0.5<br> Loop<br> myMap.Extent = rect<br> Case Else<br> Set rect = ID_Recs.Fields("shape").value.Extent<br> rect.ScaleRectangle 2<br> myMap.Extent = rect<br> myMap.Refresh<br> End Select<br><br> <br> frmMap.Map1.FlashShape ID_Recs.Fields("shape").value, 2
[此贴子已经被作者于2005-6-29 20:29:07编辑过]
|
|
4楼#
发布于:2005-06-29 20:21
'定位闪烁显示<BR><BR> Dim rect As MapObjects2.Rectangle<BR> Select Case Recs.Fields("shape").Type<BR> Case moPoint<BR> Dim MapX As Double, MapY As Double<BR> Mapx = Recs.Fields("shape").value.X<BR> MapY = Recs.Fields("shape").value.Y<BR> Map.CenterAt MapX, MapY<BR> Set rect = Map.Extent<BR> Do While rect.Width > 50<BR> rect.ScaleRectangle 0.5<BR> Loop<BR> Map.Extent = rect<BR> Case Else<BR> Set rect = Recs.Fields("shape").value.Extent<BR> rect.ScaleRectangle 2<BR> Map.Extent = rect<BR> Map.Refresh<BR> End Select<BR> <BR> Map.FlashShapeRecs.Fields("shape").value, 2
|
|
5楼#
发布于:2007-07-27 16:17
<img src="images/post/smile/dvbbs/em07.gif" />
|
|