阅读:1823回复:0
[求助]关于GIS新建图层代码的一些不明白的地方
<P>String names[] = { "MI_Lable", "MI_recordID"};<BR> int typ[] = { 7, 7};<BR> int keys[] = { 1, 2};</P>
<P> TableInfoImpl tableinfo = new TableInfoImpl("point", myMap<BR> .getDisplayCoordSys(), names, typ, (names.length), keys,<BR> false);</P> <P> AnnotationTableDescHelper annTDHelper = new AnnotationTableDescHelper("point");<BR> AnnotationDataProviderHelper annDPHelper = new AnnotationDataProviderHelper();<BR> LocalDataProviderRef localDPRef = new LocalDataProviderRef(annDPHelper);<BR> myMap.getLayers().insertLayer(localDPRef, annTDHelper, 0, "point");</P> <P><FONT color=#ff0000>//AnnotationTableDescHelper、AnnotationDataProviderHelper 和LocalDataProviderRef这三个类在新建图层的时候有什么作用?</FONT></P> <P><FONT color=#ff0000></FONT> </P> <P><FONT color=#ff0000>//下面的代码是不是设置层显示的字体和格式?</FONT></P> <P> FeatureLayer lyr = (FeatureLayer) myMap.getLayers().get("point");<BR> lyr.getLabelProperties().setVerticalAlignment(<BR> LabelProperties.VERT_ALIGN_CENTER);<BR> </P> <P> Rendition rend1 = new RenditionImpl();<BR> rend1.setValue(Rendition.SYMBOL_MODE, Rendition.SymbolMode.FONT);<BR> rend1.setValue(Rendition.FONT_FAMILY, "宋体");<BR> rend1.setValue(Rendition.FONT_WEIGHT, 10);<BR> rend1.setValue(Rendition.SYMBOL_FOREGROUND, Color.BLUE);<BR> lyr.getLabelProperties().setRendition(rend1);<BR> lyr.setAutoLabel(true);<BR> lyr.getLabelProperties().setLabelColumn(0);<BR> </P><img src="images/post/smile/dvbbs/em02.gif" /> |
|