阅读:1701回复:1
在MAPXTREME2004中,用ASP。NET时怎么样在图层中添加点
在MAPXTREME2004中,用ASP。NET时怎么样在图层中添加点
|
|
1楼#
发布于:2005-02-25 16:46
<P>apxTreme 添加点图元的函数For ASP
今天刚测试通过的,希望大家支持 参数说明:LayerName-----------tab表名,不加“.tab”,如 "china" FeatureName------------------图元名称 sStrxy--------------------存放坐标的字符串,如:“117.145424,37.454254”</P><P> Function AddPointToLayer(LayerName,FeatureName,sStrxy)</P><P> Dim bResult,objMapx,lyr Dim ftrNewPt,ftrAddPt Dim flocx,flocy,tt tt = Split(sStrxy,",",-1,1) flocx = tt(0) flocy = tt(1) Set objMapx = GetMapEngine() Set lyr = objMapx.Layers.Item(LayerName) If CreateMapFeature(ftrNewPt) = True Then </P><P> ftrNewPt.Attach objMapX ftrNewPt.Type = miFeatureTypeSymbol ftrNewPt.Style.SymbolFont.Name = "Mapinfo Symbols" ftrNewPt.Style.SymbolCharacter = 35 ftrNewPt.Style.SymbolFont.Size = 8 ftrNewPt.Style.SymbolFontColor = 255 ftrNewPt.Point.Set flocx,flocy Set ftrAddPt = lyr.AddFeature(ftrNewPt) ftrAddPt.Keyvalue = FeatureName ftrAddPt.Update</P><P> End If bResult = SetLayerProperties(lyr, True, True, True) bResult = SetMapCenter(fLocX, fLocY) Set objMapx = Nothing Set lyr = Nothing End Function</P> |
|