goodsmith
路人甲
路人甲
  • 注册日期2006-06-21
  • 发帖数1
  • QQ
  • 铜币112枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:804回复:0

[求助] 这段代码在MAPXTREME2004如何实现

楼主#
更多 发布于:2006-07-17 10:31
<P>// Given a Layer object and x- and y-coordinates, this method selects the layer's feature(s) at the specified location, and creates a SelectionTheme to display the selected features in red.</P>
<P>// Assume layer as a Layer object<BR>    Vector v = new Vector();<BR>    DoublePoint dp = new DoublePoint(x, y);<BR>    FeatureSet fs = null;</P>
<P>    // Select a feature at the specified location</P>
<P>    fs = layer.searchAtPoint(v, dp, null);<BR>    // Create a SelectionTheme<BR>    SelectionTheme selTheme = new SelectionTheme("PointSelection");</P>
<P>    // Create a Selection object, and add the selected features<BR>    Selection sel = new Selection();<BR>    sel.add(fs);</P>
<P>    // Assign the Selection object to the SelectionTheme<BR>    selTheme.setSelection(sel);</P>
<P>    // Assign the display style of the SelectionTheme<BR>    Rendition rend =RenditionImpl.getDefaultRendition();<BR>    rend.setvalue(Rendition.FILL, Color.red);<BR>    selTheme.setRendition(rend);</P>
<P>    // Add the SelectionTheme to the layer's list of themes<BR>    layer.getThemeList().add(selTheme);</P>
喜欢0 评分0
游客

返回顶部