|
阅读:804回复:0
[求助] 这段代码在MAPXTREME2004如何实现
<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> |
|