xzstock
路人甲
路人甲
  • 注册日期2004-01-30
  • 发帖数10
  • QQ
  • 铜币153枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1701回复:1

在MAPXTREME2004中,用ASP。NET时怎么样在图层中添加点

楼主#
更多 发布于:2005-02-25 16:44
在MAPXTREME2004中,用ASP。NET时怎么样在图层中添加点
喜欢0 评分0
xzstock
路人甲
路人甲
  • 注册日期2004-01-30
  • 发帖数10
  • QQ
  • 铜币153枚
  • 威望0点
  • 贡献值0点
  • 银元0个
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>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部