Package com.luciad.wmts.server
Interface ILcdWMTSGetLegendGraphicRequestEncoder
- All Known Implementing Classes:
TLcdDefaultWMTSGetLegendGraphicEncoder
public interface ILcdWMTSGetLegendGraphicRequestEncoder
Creates and encodes legend graphics to a specific content type.
The type of encoding is defined by the actual implementations.
Each
Each
ILcdWMTSLegendGraphicRequestEncoder has a content type that identifies the type of data
encoded by the implementation. This is usually the MIME - TYPE of the encoded result.- Since:
- 2022.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanencode(TLcdWMTSGetLegendGraphicRequestContext aWMTSGetLegendGraphicRequestContext, OutputStream aOutputStream) Encodes the legend graphic for a givenTLcdWMTSGetLegendGraphicRequestContextand sends it to the givenOutputStream.Returns the content MIME type of the encoder.default TLcdWMTSLegendURLParametersgetLegendURL(String aLayer, String aStyle, TLcdWMTSLegendURLParameters aDefaultLegendURL) Determines the href, width and height to advertise in theLegendURLfor the given layer and style.
-
Method Details
-
getContentType
String getContentType()Returns the content MIME type of the encoder.- Returns:
- the MIME-type as
String.
-
encode
boolean encode(TLcdWMTSGetLegendGraphicRequestContext aWMTSGetLegendGraphicRequestContext, OutputStream aOutputStream) throws IOException Encodes the legend graphic for a givenTLcdWMTSGetLegendGraphicRequestContextand sends it to the givenOutputStream.- Parameters:
aWMTSGetLegendGraphicRequestContext- a container for all relevant information that might be useful when generating legends.aOutputStream- theOutputStreamto write the output to.- Returns:
- True if the encoder can handle this case, false if it does not.
- Throws:
IOException- for any I/O Exceptions.
-
getLegendURL
default TLcdWMTSLegendURLParameters getLegendURL(String aLayer, String aStyle, TLcdWMTSLegendURLParameters aDefaultLegendURL) Determines the href, width and height to advertise in theLegendURLfor the given layer and style.aDefaultLegendURLholds the parameters that would otherwise be advertised: an href pointing to aGetLegendGraphicrequest on this encoder, and the default configured legend dimensions. Implementations can:- return
aDefaultLegendURLunchanged, to keep that default behavior; - return a different
TLcdWMTSLegendURLParameters, to override the width, the height, the href, or all three — for example to advertise a static, externally-hosted legend image instead of a dynamically-generated one; - return
null, to indicate this encoder has no opinion on this layer and style. If another encoder shares this encoder's content type, that encoder is consulted next; if none of them return a non-nullresult, noLegendURLis advertised for this content type, for this layer and style.
aDefaultLegendURLunchanged is not the same as returningnull: the former confirms the default is correct for this layer and style and stops any further encoders sharing this content type from being consulted, while the latter defers that decision to them. By default, returnsaDefaultLegendURLunchanged, which preserves the behavior prior to the introduction of this method.- Parameters:
aLayer- the identifier of the layer for which aLegendURLis being advertised.aStyle- the identifier of the style for which aLegendURLis being advertised.aDefaultLegendURL- the parameters that would otherwise be advertised.- Returns:
- the parameters to advertise, a modified copy of
aDefaultLegendURL, ornull. - Since:
- 2026.0.15
- return
-