- GIS论坛-GIS空间站 ( http://bbs.gissky.net/Default.asp )
-- Intergraph ( http://bbs.gissky.net/ShowForum.asp?forumid=28 )
--- G/GAS下Locate方法出现奇怪问题,各位达人帮忙! ( http://bbs.gissky.net/ShowPost.asp?id=16237 )
作者:Nickeysoft
发表时间:2005-7-6 14:13:09
Public Function SelectFeatureByPolygon(ByVal Pt() As Pt2d, ByVal NVer As Integer) As GRecordset On Error GoTo err1 Dim polyGeometry As PBasic.RectangleGeometry Dim locatedObj As Object Dim smartLoc As Object Dim GMMapView1 As GMMapView
polyGeometry = gobjGeoApp.CreateService("GFramme.RectangleGeometry") GMMapView1 = gobjGeoApp.ActiveWindow.MapView locatedObj = gobjGeoApp.CreateService("GFramme.LocatedObjectsCollection") smartLoc = gobjGeoApp.CreateService("GFramme.SmartLocateService")
With polyGeometry .Origin.X = Pt(0).x .Width = Abs(Pt(0).x - Pt(1).x) .Origin.Y = Pt(0).y .Height = Abs(Pt(0).y - Pt(1).y) End With
GMMapView1.HighlightedObjects.Clear() GMMapView1.MapViewSelectedObjects.Clear()
smartLoc.FenceMode = PBasic.GMFenceModeConstants.locFenceInside [color=#ff0000]smartLoc.Locate(polyGeometry, GMMapView1.Dispatch, locatedObj) <------这一句在执行中出错[color=#000000]
Dim I As Integer For I = 1 To locatedObj.Count GMMapView1.Dispatch.MapViewSelectedObjects.SetDisplayColor(RGB(255, 255, 0)) GMMapView1.Dispatch.MapViewSelectedObjects.Add(locatedObj(I)) Next I
Exit Function err1: MsgBox(Err.Description) End Function
开发环境为G/GAS 9.2.1 + VisualStudio.NET 2003,错误提示为“该特性为只读特性”,哪位高手帮忙解决一下啊?小弟不胜感激[/color][/color][/color][/color]
[此帖子已被 Nickeysoft 在 2005-7-6 14:14:59 编辑过]
|