public class TLcyWMTSClientGetFeatureInfoAddOn extends ALcyFormatAddOn
This add-on allows to select and inspect the properties of objects visualized on a WMTS layer. It uses GetFeatureInfo requests to do this. This add-on also adds support to visualize GetFeatureInfo responses for GXY views.
Note that in order to visualize the GetFeatureInfo responses on a Lightspeed view, the
TLcyLspWMTSClientGetFeatureInfoAddOn
add-on is required in addition to this one.
This add-on registers a format that is used to visualize GetFeatureInfo layers. By overriding the
createBaseFormat()
method, it is possible to return a custom format that for example customizes
the layer creation.
The format that is returned by default has disabled all workspace support, meaning that the GetFeatureInfo layer will not be saved to the workspace. The consequence of this is that currently visualized GetFeatureInfo responses on the map will not be visualized anymore when reloading a workspace.
To see how these GetFeatureInfo requests are performed, and how the responses are converted to layers,
see samples.ogc.wmts.client.common.WMTSGetFeatureInfoMouseListener
. The functionality in this add-on
is based on this sample class. When clicking on a WMTS layer with the select controller, the following happens:
ILcdModel
,
and visualize it on the map. When the response contains a geometry (ALcdShape#fromDomainObject
),
the geometry will be visualized. Otherwise, a point will be visualized at the location of the request.TLcySelectionEditorAddOn
can show the object properties
of the selected objects by looping over the available ILcyCustomizerPanelFactory
instances. Registering
your own ILcyCustomizerPanelFactory
for the GetFeatureInfo domain objects allows to customize the
object properties panel. You can use the constants in this class to recognize those domain objects, and to
retrieve the info available in the GetFeatureInfo response domain objects.Constructor and Description |
---|
TLcyWMTSClientGetFeatureInfoAddOn()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected ALcyFormat |
createBaseFormat()
Returns a new data format for this add-on.
|
protected ALcyFormat |
createFormatWrapper(ALcyFormat aBaseFormat)
Returns a new data format wrapper for this add-on.
|
void |
plugInto(ILcyLucyEnv aLucyEnv)
Creates and plugs in the add-on's format.
|
createFormatTool, getFormat, unplugFrom
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
public TLcyWMTSClientGetFeatureInfoAddOn()
public void plugInto(ILcyLucyEnv aLucyEnv)
ALcyFormatAddOn
Creates and plugs in the add-on's format.
plugInto
in class ALcyFormatAddOn
aLucyEnv
- the Lucy environment to plug intoALcyAddOn.unplugFrom(com.luciad.lucy.ILcyLucyEnv)
protected ALcyFormat createBaseFormat()
ALcyFormatAddOn
Returns a new data format for this add-on. Override this method to extend the default format with new functionality.
For example, to alter the icon of the layers of this format, you can decorate the layer factory created in the format:
@Override
protected ALcyFormat createBaseFormat() {
return new ALcyFormatWrapper(super.createBaseFormat()){
@Override
protected ILcdGXYLayerFactory createGXYLayerFactory(){
final ILcdGXYLayerFactory delegate = super.createGXYLayerFactory();
return new ILcdGXYLayerFactory(){
@Override
public ILcdGXYLayer createGXYLayer(ILcdModel aModel){
ILcdGXYLayer layer = delegate.createGXYLayer(aModel);
if (layer != null){
ILcdIcon icon = ...;
layer.setIcon(icon);
}
return layer;
}
}
}
}
}
createBaseFormat
in class ALcyFormatAddOn
protected final ALcyFormat createFormatWrapper(ALcyFormat aBaseFormat)
ALcyFormatAddOn
Returns a new data format wrapper for this add-on. A format wrapper extends the base format with aspects such as asynchronous painting, mutable file behavior, safe guarding, etc.
Overriding this method of an existing add-on should be done with extreme care as add-ons typically rely on the wrappers that should be present (e.g. a safe guard).
createFormatWrapper
in class ALcyFormatAddOn
aBaseFormat
- the base format to wrapALcyFormatWrapper