Class TLcyWMSClientGetFeatureInfoAddOn
This add-on allows to select and inspect the properties of objects visualized on a WMS 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
TLcyLspWMSClientGetFeatureInfoAddOn
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.wms.client.common.WMSGetFeatureInfoMouseListener
. The functionality in this add-on
is based on this sample class. When clicking on a WMS layer with the select controller, the following happens:
- This add-on will send a GetFeatureInfo request to the WMS server for the mime types specified in the config file of this add-on. It will use the first mime type that is supported by the WMS server, so the order in which the mime types are specified is important. It is possible to specify other mime types in the config file.
- When this add-on receives the response of the WMS server, it will convert it to an
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. The visualized object will be selected as well. When the"application/json"
,"application/vnd.ogc.gml/3.1.1"
or"application/vnd.ogc.gml"
mime type is used, a shape will be returned by the server. In all other cases, also when using a custom mime type, anILcdDataObject
using theDATA_TYPE
data type will be used. - Similar to all other formats in Lucy, the
TLcySelectionEditorAddOn
can show the object properties of the selected objects by looping over the availableILcyCustomizerPanelFactory
instances. Registering your ownILcyCustomizerPanelFactory
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.
- Since:
- 2016.1
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TLcdDataProperty
Property that defines the content format of the GetFeatureInfo request.static final TLcdDataProperty
Property that defines the content of the GetFeatureInfo response.static final TLcdDataModel
The data model that declares the data type that is used for the decoded GetFeatureInfo responses.static final TLcdDataType
The data type of the decoded GetFeatureInfo responses.static final TLcdDataProperty
Property that defines the location of the GetFeatureInfo request in model coordinates.static final TLcdDataProperty
Property that contains a name for the FeatureInfo object.static final TLcdDataType
The data type used for the location property. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ALcyFormat
Returns a new data format for this add-on.protected final 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.Methods inherited from class com.luciad.lucy.addons.ALcyFormatAddOn
createFormatTool, getFormat, unplugFrom
Methods inherited from class com.luciad.lucy.addons.ALcyPreferencesAddOn
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix
Methods inherited from class com.luciad.lucy.addons.ALcyAddOn
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
-
Field Details
-
DATA_MODEL
The data model that declares the data type that is used for the decoded GetFeatureInfo responses. This data model is only used when using a mime-type other thanapplication/json
,application/vnd.ogc.gml/3.1.1
orapplication/vnd.ogc.gml
. -
DATA_TYPE
The data type of the decoded GetFeatureInfo responses. This type defines the following properties:
-
SHAPE_DATA_TYPE
The data type used for the location property. -
LOCATION_PROPERTY
Property that defines the location of the GetFeatureInfo request in model coordinates. Can benull
if the location is unknown. This property hasSHAPE_DATA_TYPE
as type. -
CONTENT_FORMAT_PROPERTY
Property that defines the content format of the GetFeatureInfo request. This property hasString
values. See alsoALcdWMSProxy.getFeatureInfoFormat()
andTLcdWMSGetFeatureInfoParameters.getFeatureInfoFormat()
. -
NAME_PROPERTY
Property that contains a name for the FeatureInfo object. This property hasString
values. -
CONTENT_PROPERTY
Property that defines the content of the GetFeatureInfo response. This property hasbyte[]
values.
-
-
Constructor Details
-
TLcyWMSClientGetFeatureInfoAddOn
public TLcyWMSClientGetFeatureInfoAddOn()Default constructor
-
-
Method Details
-
plugInto
Description copied from class:ALcyFormatAddOn
Creates and plugs in the add-on's format.
- Overrides:
plugInto
in classALcyFormatAddOn
- Parameters:
aLucyEnv
- the Lucy environment to plug into- See Also:
-
createBaseFormat
Description copied from class: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; } } } } }
- Specified by:
createBaseFormat
in classALcyFormatAddOn
- Returns:
- a new format for this add-on
-
createFormatWrapper
Description copied from class: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).
- Specified by:
createFormatWrapper
in classALcyFormatAddOn
- Parameters:
aBaseFormat
- the base format to wrap- Returns:
- a new format for this add-on
- See Also:
-