本文整理汇总了Java中org.gwtopenmaps.openlayers.client.feature.VectorFeature.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Java VectorFeature.setStyle方法的具体用法?Java VectorFeature.setStyle怎么用?Java VectorFeature.setStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gwtopenmaps.openlayers.client.feature.VectorFeature
的用法示例。
在下文中一共展示了VectorFeature.setStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入方法依赖的package包/类
public VectorFeature[] read(String vectorFormatString) {
JSObject out = FormatImpl.read(getJSObject(), vectorFormatString);
JObjectArray jObjectArray = JObjectArray.narrowToJObjectArray(out.ensureOpaqueArray());
int nr = jObjectArray.length();
VectorFeature[] vfs = new VectorFeature[nr];
for (int i = 0; i < nr; i++) {
VectorFeature vf = VectorFeature.narrowToVectorFeature(jObjectArray.get(i));
JSObject styleObject = jObjectArray.get(i).getProperty(STYLE_NAME);
if (styleObject != null) {
VectorFeatureStyleDef def = getStyleDef(styleObject);
vf.setStyle(def.toStyle(vf));
}
vfs[i] = vf;
}
return vfs;
}
示例2: applyFeatureStyle
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入方法依赖的package包/类
public void applyFeatureStyle(VectorFeature feature, VectorLayer layer) {
VectorFeatureStyleDef featureStyle = new VectorFeatureStyleDef(feature, layer);
applyStyle(featureStyle, layer);
feature.setStyle(featureStyle.toStyle(feature));
}