本文整理汇总了Java中org.gwtopenmaps.openlayers.client.feature.VectorFeature类的典型用法代码示例。如果您正苦于以下问题:Java VectorFeature类的具体用法?Java VectorFeature怎么用?Java VectorFeature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VectorFeature类属于org.gwtopenmaps.openlayers.client.feature包,在下文中一共展示了VectorFeature类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getTransformedFeatures
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
private VectorFeature[] getTransformedFeatures(Vector vectorLayer, String epsg) {
List<VectorFeature> transformedFeatures = new ArrayList<VectorFeature>();
if (vectorLayer.getFeatures() != null) {
// logger.info("N. features de la Capa: " + layer.getFeatures().length);
for (VectorFeature feature : vectorLayer.getFeatures()) {
VectorFeature featureToExport = feature.clone();
featureToExport.getGeometry().transform(
new Projection(GeoMap.INTERNAL_EPSG),
new Projection(epsg));
transformedFeatures.add(featureToExport);
}
}
VectorFeature[] transArray = new VectorFeature[transformedFeatures
.size()];
return transformedFeatures.toArray(transArray);
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:17,代码来源:SaveProjectTool.java
示例2: featureMatchesSchema
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
private boolean featureMatchesSchema(VectorFeature feature) {
boolean matches = true;
if(feature.getAttributes().getAttributeNames().size() == featureSchema.getNumAttributes()) {
for(String attributeName : feature.getAttributes().getAttributeNames()) {
if(!featureSchema.hasAttribute(attributeName)) {
matches = false;
break;
}
}
} else {
matches = false;
}
return matches;
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:17,代码来源:VectorLayer.java
示例3: setSelectedElement
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
private void setSelectedElement() {
List<VectorFeature> selectedElements =
featureGrid.getSelectionModel().getSelectedItems();
if (selectedElements != null && !selectedElements.isEmpty()) {
for (FeatureTool tool : layerInfoToolBar.getTools()) {
tool.setSelectedLayer(selectedLayer);
if (selectedElements.size() > 1) {
tool.setSelectedFeatures(selectedElements);
} else {
tool.setSelectedFeature(selectedElements.get(0));
}
}
}
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:18,代码来源:LayerInfoDialog.java
示例4: createKmlVectorLayer
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
public static VectorLayer createKmlVectorLayer(
final VectorLayerConfig layerConfig) {
final KML kmlReader = new KML(createFormatOptions(layerConfig));
kmlReader.setExtractStyles(true);
kmlReader.setExtractAttributes(true);
kmlReader.getJSObject().setProperty("kvpAttributes", true);
kmlReader.getJSObject().setProperty("foldersName", (String) null);
kmlReader.getJSObject().setProperty("foldersDesc", (String) null);
final VectorFeature[] features = kmlReader.read(layerConfig
.getGeoDataString());
final VectorLayer layer = createEmptyVectorLayer(layerConfig);
layer.addFeatures(features);
return layer;
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:18,代码来源:VectorLayerFactory.java
示例5: getFeatureAddedListener
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
public VectorFeatureAddedListener getFeatureAddedListener(final Vector layer) {
return new VectorFeatureAddedListener() {
@Override
public void onFeatureAdded(FeatureAddedEvent eventObject) {
if (getValue() && enableEvent) {
final VectorFeature lineVectorFeature = eventObject
.getVectorFeature();
taskManager.execute(new Runnable() {
@Override
public void run() {
detectPolygonIntersected(lineVectorFeature, layer);
}
});
}
}
};
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:23,代码来源:DivideTool.java
示例6: createGeoJsonCssVectorLayer
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
public static VectorLayer createGeoJsonCssVectorLayer(
VectorLayerConfig layerConfig) {
GeoJSONCSS geoJSONCSSReader = new GeoJSONCSS();
geoJSONCSSReader.getJSObject().setProperty("ignoreExtraDims", true);
VectorFeature[] features = geoJSONCSSReader.read(layerConfig.getGeoDataString());
layerConfig.setFeatures(features);
VectorLayer vector = createVectorLayer(layerConfig);
VectorStyleDef vectorStyleDef = geoJSONCSSReader.getLayerStyle(layerConfig.getGeoDataString());
if(vectorStyleDef != null) {
vector.setVectorStyle(vectorStyleDef);
}
return vector;
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:18,代码来源:VectorLayerFactory.java
示例7: confirmBufferSelectedElements
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
private void confirmBufferSelectedElements(final VectorFeature... vectorFeatures) {
final PromptMessageBox messageBox = new PromptMessageBox(
UIMessages.INSTANCE.btMessageBoxPromptTitle(),
UIMessages.INSTANCE.btMessageBoxPromptLabel());
messageBox.getButton(PredefinedButton.OK).addSelectHandler(
new SelectHandler() {
@Override
public void onSelect(final SelectEvent event) {
final String value = messageBox.getValue();
applyBuffer(Double.parseDouble(value), vectorFeatures);
}
});
messageBox.show();
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:17,代码来源:BufferTool.java
示例8: isSelectedFeatures
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
private boolean isSelectedFeatures() {
boolean isSelected = false;
final VectorLayer selectedLayer = exportDataDialog.getVectorLayer();
if (isLayerToExportValid(selectedLayer)) {
final VectorFeature[] selectedFeatures = selectedLayer
.getSelectedFeatures();
if (selectedFeatures != null && selectedFeatures.length > 0) {
isSelected = true;
}
}
return isSelected;
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:17,代码来源:ExportDataTool.java
示例9: initialize
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
@PostConstruct
private void initialize() {
customExtentDialog.getAddToMapButton().addSelectHandler(
new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
if (!isBBoxEmpty() && has4Coordinates()) {
Bounds bounds = getBounds();
Geometry geom = bounds.toGeometry();
geom.transform(new Projection("EPSG:4326"),
new Projection(geoMap.getMap()
.getProjection()));
VectorFeature vf = new VectorFeature(geom);
VectorLayer bboxLayer = VectorLayerFactory
.createEmptyVectorLayer(createBBoxLayerConfig());
bboxLayer.addFeature(vf);
layerManager.addVector(bboxLayer);
}
}
});
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:27,代码来源:CustomExtentTool.java
示例10: search
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
@Override
public List<VectorFeature> search(List<VectorFeature> features,
String valueToSearch, String attributeName, boolean caseSensitive) {
List<VectorFeature> filteredFeatures = new ArrayList<VectorFeature>();
for (VectorFeature vector : features) {
String attributeValue = getAttributeValue(vector, attributeName);
if (caseSensitive) {
if (hasBeenFound(attributeValue, valueToSearch, attributeName)) {
filteredFeatures.add(vector);
}
} else {
if (hasBeenFound(attributeValue.toUpperCase(),
valueToSearch.toUpperCase(),
attributeName)) {
filteredFeatures.add(vector);
}
}
}
return filteredFeatures;
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:24,代码来源:VectorFeatureSearcher.java
示例11: search
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
private void search(Searcher searcher) {
String attributeName = attributeCombo.getValue().getName();
String attributeValue = valueAttributeField.getValue();
List<VectorFeature> filteredFeatures = null;
try {
List<VectorFeature> features = Arrays.asList(selectedLayer
.getFeatures());
filteredFeatures = searcher.search(features, attributeValue,
attributeName, isCaseSensitive.getValue());
} catch (Exception e) {
messageDialogBuilder.createError(UIMessages.INSTANCE.warning(),
e.getMessage());
logger.error(e.getMessage());
}
featureGrid.update(filteredFeatures);
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:20,代码来源:AttributeSearchDialog.java
示例12: applyBufferZero
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
private void applyBufferZero(final VectorFeature vectorFeature) {
WKT wktFormat = new WKT();
int BufferDistance = 0;
jtsServiceAsync.getBuffer(wktFormat.write(vectorFeature),
BufferDistance,
new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
messageDialogBuilder.createError(
UIMessages.INSTANCE.fail(),
"Error: " + caught.getMessage()).show();
}
public void onSuccess(String wktBuffer) {
VectorLayer vector = (VectorLayer) getLayer();
VectorFeature newVectorFeature = new VectorFeature(
Geometry.fromWKT(wktBuffer));
vector.addFeature(newVectorFeature);
vectorFeature.destroy();
}
});
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:25,代码来源:CircleTool.java
示例13: addFeatures
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
@Override
public void addFeatures(VectorFeature[] features) {
if(features != null && features.length > 0) {
initializeLayerFeatureSchema(features[0]);
/**
* Consideramos que todas las features del array tienen el mismo esquema,
* para asi no tener que comprobarlo para cada una de ellas (por rendimiento)
*/
if(!featureMatchesSchema(features[0])) {
for(VectorFeature f : features) {
checkFeature(f);
}
}
super.addFeatures(features);
}
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:19,代码来源:VectorLayer.java
示例14: getTransformedFeatures
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
public VectorFeature[] getTransformedFeatures(Vector layer, String epsg) {
List<VectorFeature> transformedFeatures = new ArrayList<VectorFeature>();
if (layer.getFeatures() != null) {
for (VectorFeature feature : layer.getFeatures()) {
VectorFeature featureToExport = feature.clone();
featureToExport.getGeometry().transform(
new Projection(geoMap.getMap().getProjection()),
new Projection(epsg));
transformedFeatures.add(featureToExport);
}
}
VectorFeature[] transArray = new VectorFeature[transformedFeatures
.size()];
return transformedFeatures.toArray(transArray);
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:16,代码来源:ExportDataTool.java
示例15: addAttribute
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
public void addAttribute(String name, Boolean showInTooltip) {
this.featureSchema.addAttribute(name, AttributeType.STRING, showInTooltip);
//Actualizamos el esquema de todas las features
if(getNumberOfFeatures() > 0) {
for(VectorFeature feature : getFeatures()) {
feature.getAttributes().setAttribute(name, (String)null);
}
}
redraw();
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:12,代码来源:VectorLayer.java
示例16: addAttributesToFeature
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
private void addAttributesToFeature(CsvItem csvItem, VectorFeature feature,
String csvAttrToBind) {
for (String attrName : csvItem.getAttributeNames()) {
if (!csvAttrToBind.equals(attrName)) {
feature.getAttributes().setAttribute(attrName,
csvItem.getValue(attrName));
}
}
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:10,代码来源:JoinDataTool.java
示例17: setSelectedFeature
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
@Override
public void setSelectedFeature(VectorFeature selectedFeature) {
this.selectedFeature = selectedFeature;
this.selectedFeatures = new ArrayList<VectorFeature>();
this.selectedFeatures.add(selectedFeature);
setEnabled(selectedFeature != null);
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:8,代码来源:DeleteVectorFeatureTool.java
示例18: removeLastPoint
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
private void removeLastPoint(VectorLayer vehicleLayer, String plate) {
List<VectorFeature> features = Arrays.asList(vehicleLayer.getFeatures());
for(VectorFeature feature: features) {
String featurePlate = feature.getAttributes().getAttributeAsString(PLATE);
if(plate.equals(featurePlate)) {
vehicleLayer.removeFeature(feature);
break;
}
}
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:12,代码来源:LastPointRegisterVehicleTool.java
示例19: updateData
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
private void updateData() {
layerNameField.setText(selectedLayer.getName());
layerNameField.setToolTip(selectedLayer.getName());
projectionField.setText(selectedLayer.getProjection()
.getProjectionCode());
numElementsField.setText("0");
if (selectedLayer.getFeatures() == null) {
featureGrid.rebuild(new ArrayList<VectorFeature>());
} else {
numElementsField.setText(Integer.toString(((Vector) selectedLayer)
.getNumberOfFeatures()));
featureGrid.rebuild(selectedLayer.getFeatures());
}
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:16,代码来源:LayerInfoDialog.java
示例20: getHtmlReport
import org.gwtopenmaps.openlayers.client.feature.VectorFeature; //导入依赖的package包/类
public HTML getHtmlReport() {
VectorLayerTemplate template = GWT.create(VectorLayerTemplate.class);
VectorFeature[] features = getSelectedVectorLayer().getFeatures();
if (features == null) {
features = new ArrayList<VectorFeature>()
.toArray(new VectorFeature[0]);
}
return new HTML(template.renderTemplate(UIMessages.INSTANCE,
getSelectedVectorLayer(), getAttributesValue(features),
getAttributeNames()));
}
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:12,代码来源:HtmlReportLayerTool.java
注:本文中的org.gwtopenmaps.openlayers.client.feature.VectorFeature类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论