public final class MilitarySymbolFeatureHandlesProvider extends Object implements AutoCloseable, IFeatureHandlesProvider
public static class MyEditConfiguration implements IFeatureEditConfiguration {
@Override
public void edit(Feature feature, long layerId, Map map, FeatureEditConfigurationBuilder builder) {
builder.handlesProvider(new MilitarySymbolFeatureHandlesProvider());
builder.submit();
}
}
public static void enableCustomEditing(IFeatureModel militarySymbologyModel) {
// Create a layer from a military symbols model and make it editable using a custom configuration
FeatureLayer layer = FeatureLayer.newBuilder() //
.model(militarySymbologyModel)
.editable(true)
.editConfiguration(new MyEditConfiguration())
.build();
}
Editor
Constructor and Description |
---|
MilitarySymbolFeatureHandlesProvider()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canProvide(Observable<Feature> feature,
FeatureEditContext context)
Indicates if this handles provider can create handles for the given
Feature . |
void |
close() |
protected void |
finalize() |
IEditHandles |
provide(Observable<Feature> feature,
FeatureEditContext context,
IFeatureEditCallback featureEditCallback)
Returns handles for the given feature.
|
public MilitarySymbolFeatureHandlesProvider()
public void close()
close
in interface AutoCloseable
public boolean canProvide(@NotNull Observable<Feature> feature, @NotNull FeatureEditContext context)
Feature
.canProvide
in interface IFeatureHandlesProvider
feature
- an observable Feature
.context
- the context. Contains additional information about the edited feature.Feature
.@Nullable public IEditHandles provide(@NotNull Observable<Feature> feature, @NotNull FeatureEditContext context, @NotNull IFeatureEditCallback featureEditCallback)
If this provider doesn't support the given feature, it can return null
.
provide
in interface IFeatureHandlesProvider
feature
- the observable feature for which to create handles.context
- the context. Contains additional information about the edited feature.featureEditCallback
- a callback that notifies the caller when the Feature
has changed.null
.