Package com.kheops.jmap.client.layers
Class Layer
java.lang.Object
com.kheops.jmap.metadata.LocalizedObject
com.kheops.jmap.client.layers.Layer
- All Implemented Interfaces:
JMapEventDispatcher
,ILayer
,LayerConstants
,LayerNode
,Serializable
,Cloneable
,Comparable<Layer>
- Direct Known Subclasses:
RasterLayer
,VectorLayer
public abstract class Layer
extends LocalizedObject
implements ILayer, LayerNode, LayerConstants, JMapEventDispatcher, Cloneable, Comparable<Layer>
This abstract class represents a layer of information on the map. A layer is
an organized set of spatial data and attributes that are displayed together.
All layer instances are managed by a layer manager (LayerManager). When the map is drawn on a view (View), all layers managed by the layer manager associated with this view are drawn, one on top of the other, starting with the lower position layer up to the higher position layer. Every layer has one or more style objects (Style) that define how the content of the layer is rendered in the view.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final K2DTransform
protected String
The description of the layer.static final int
Constant used to specify that layer drawing should be done synchronously.protected K2DTransform
protected int
protected K2DElementFactory
protected int
The type of elements this layer contains.protected final LayerEventDispatcher
protected int
The id of the layer.protected JMapClientInfoReportConfig
protected long
static final int
This constant refers to the reserved layer id for the layer containing highlight objects NOTE: different than SYS_DRAWINGS layer because the highlight tool constantly changes its location depending on the highlighted layerstatic final int
This constant refers to a reserved layer id used by the administration extension.static final int
This constant refers to the reserved layer id for the layer containing the labelsstatic final int
This constant refers to a reserved layer id used for the View Markers.static final int
This constant refers to a reserved layer id used by drawing tools.static final int
This constant refers to the reserved layer id for the layer containing the temporary drawings Ex: DistanceTool, temporary line drawn when the user moves the mouse 3D Distance/routing, possible route choicesstatic final int
Set the correct numbers for the constants below, and use constants instead of specifying the ID everywhere in JMap This constant refers to the reserved layer id for the layer containing the user drawingsstatic final int
This constant refers to a reserved layer id used for user layer labeling.protected long
Layer properties are stored as bitwise values in this property.protected double
protected String
protected double
protected String
The name of the layer.protected PrecisionModel
protected long
protected StyleManager
protected boolean
Fields inherited from interface com.kheops.jmap.client.layers.ILayer
serialVersionUID
Fields inherited from interface com.kheops.jmap.client.layers.LayerConstants
DEFAULT_MAXIMUM_SCALE, DEFAULT_MINIMUM_SCALE, PERSONAL_LAYER_BASE_ID, PERSONAL_LAYER_MAX_ID, PROJECT_LAYER_BASE_ID, PROJECT_LAYER_MAX_ID, PROPERTY_ALL_SETTINGS, PROPERTY_ALWAYS_DRAW_SELECTION, PROPERTY_DRAW_GRID, PROPERTY_EDITABLE, PROPERTY_EDITING, PROPERTY_INCLUDE_IN_CONTEXT, PROPERTY_INDEX, PROPERTY_LISTED, PROPERTY_LOCAL, PROPERTY_MAX_SCALE, PROPERTY_MIN_SCALE, PROPERTY_PUBLISHED, PROPERTY_QUERIABLE, PROPERTY_SELECTABLE, PROPERTY_USE_CLIENT_CACHE, PROPERTY_VISIBLE, REQUEST_MODE_BY_REGION, REQUEST_MODE_BY_TILE, RESERVED_LAYER_BASE_ID, RESERVED_LAYER_MAX_ID, SYSTEM_LAYER_BASE_AUTO_ID, SYSTEM_LAYER_BASE_ID, SYSTEM_LAYER_MAX_ID, TILING_MODE_AUTO, TILING_MODE_MANUAL, USER_LAYER_BASE_AUTO_ID, USER_LAYER_BASE_ID, USER_LAYER_MAX_ID
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Layer()
Empty constructor.Deprecated.Creates a new Layer using the specified parameters.
The new layer will be configured with only one tile with an infinite size.Initializes the new layer using the specified JMapClientLayerInfo. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayerEventListener
(LayerEventListener listener) Added the specified listener to the layer listeners list.abstract Object
clone()
Returns a deep clone of the current LayerInfo instance.protected void
Implementation of the clone method.abstract void
close()
Frees all resources used by the layer.int
Compares this object with the specified layer for order.void
dispatchEvent
(JMapEvent event) ThedispatchEvent
method is used to dispatch synchronously JMap events to all registered listeners.void
draw
(GraphicsRef gr, ViewState vs, OrientedRectangle region, double scale, int drawOptions) Deprecated.abstract void
draw
(GraphicsRef gr, ViewState vs, OrientedRectangle region, double scale, DrawParameters parameters) Draws layer contained in the specified region to the specified graphics object and applying the specified transformation.boolean
drawGrid()
Returns the draw grid state.abstract void
drawGrid
(GraphicsRef gr, K2DTransform t) Draws the tile grid for the layer.protected void
fireLayerPropertyBeforeChangeEvent
(byte property) protected void
fireLayerPropertyChangedEvent
(byte property) protected void
fireLayerReceivedDataEvent
(LayerReceivedDataEvent event, boolean sync) protected void
Fires refresh request event so that the listener can handle the event properlyprotected void
Returns the description of the layer.getDescription
(Locale locale) Returns the description of this layer for a specific locale.int
Gets the time at which a layer is automatically refreshedReturns the K2DElementFactory configured for the layer.int
Returns the layer element type.abstract Rectangle
Returns the extent of the layer.int
getId()
Returns the id of the layer.Return the information report configuration of the layer.long
Gets the last updated timelong
Returns a bitwise value that contains all layer properties.double
Gets the maximum scale at which the layer should be visible.Returns the metadata URL.double
Gets the minimum scale at which the layer should be visible.getName()
Returns the name of the layer.Returns the name of this layer for a specific locale.static int
static int
Returns the precision model to use for geometrical operations.long
Returns the a mask which contains all read-only properties for this layer.abstract int
Returns the request mode for this layer.Returns the default selection style object associated with the layer.
Note: If this layer has more than one style (depending on the zoom level), the lowest level selection style is returned.getSelectionStyle
(double scale) Returns the selection style object associated with the layer for the specified scale.getStyle()
Returns the default style object associated with the layer.
Note: If this layer has more than one style (depending on the zoom level), the lowest level style is returned.getStyle
(double scale) Returns the style object associated with the layer (used to draw elements of the layer).Returns the StyleManager instance used by the Layer.boolean
Returns whether the verbose mode is enabled.protected LayerEventDispatcher
void
Invalidates the cached data for vector and raster layers.boolean
isDrawable
(double scale) Returns true if this layer should be drawn at the specified scale.boolean
boolean
Returns whether this layer should be included in contexts.boolean
isIndex()
Returns whether this layer should be drawn in the client overview.boolean
isListed()
Returns the current listed state of the layer.boolean
isLocal()
Returns the current local state of the layer.boolean
Checks if the layer is named (including available translations, case insensitive) as the specified value.static boolean
isPersonalLayerId
(int layerId) static boolean
isProjectLayerId
(int layerId) boolean
Deprecated.As of release 4.0, the QUERIABLE property is not used anymorestatic boolean
isReservedLayerId
(int layerId) boolean
Returns the current selectable state of the layer.static boolean
isSystemLayerId
(int layerId) static boolean
isUserLayerId
(int layerId) boolean
Returns the current visibility state of the layerabstract void
This method automatically loads the data intersecting with the specified geometry.void
removeLayerEventListener
(LayerEventListener listener) Removes the specified listener from the layer listeners list.void
removeTranslationsOtherThan
(Locale[] locales) Removes anyLocale
from this object that are not in the specifiedlocales
.void
Revalidates cached data based on the specified affine transformation.void
setDescription
(String description) Sets the description string for the layer.void
setDescription
(String description, Locale locale) Sets the description of this layer for the specified Locale.void
setDrawGrid
(boolean drawGrid) Sets the draw grid state.void
setDynamicRefresh
(int seconds) Sets the time at which a layer is automatically refreshed.void
setElementFactory
(K2DElementFactory elementFactory) Sets the K2DElementFactory to be used by this layer.void
setElementType
(int elementType) Sets the layer element type.void
setId
(int id) Sets the id of the layer.void
setIncludeInContext
(boolean includeInContext) Sets whether this layer should be included in contexts.void
setIndex
(boolean flag) Sets whether this layer should be drawn in the client overview.void
setInfoReportConfig
(JMapClientInfoReportConfig infoReportConfig) Sets the information report configuration of the layer.void
setLastUpdateTime
(long lastUpdateTime) Sets the last updated timevoid
setLayerProperties
(long value) Sets all layer properties.void
setListed
(boolean listed) Sets the listed state of the layer.void
setLocal
(boolean flag) Sets the local state of the layer.void
setMaximumVisibleScale
(double scale) Sets the maximum scale at which the layer should be visible.void
setMetadataUrl
(String metadataUrl) Sets the metadata URL.void
setMinimumVisibleScale
(double scale) Sets the minimum scale at which the layer should be visible.void
Sets the layer name.void
Sets the name of this layer for the specified Locale.void
setPrecisionModel
(PrecisionModel precisionModel) Sets the precision model to use for geometrical operations.final void
setProperty
(long property, boolean enabled) Sets the state for the specified property.void
setQueriable
(boolean flag) Deprecated.As of release 4.0, the QUERIABLE property is not used anymorevoid
setReadOnlyProperties
(long value) Sets all read-only properties for the layer.final void
setReadOnlyProperty
(long property, boolean isReadOnly) Sets the read-only state for the specified property.void
setSelectable
(boolean flag) Sets the selectable state of the layer.void
Deprecated.since JMap 2.5void
Sets the default style at the specified scale for this layer.void
setStyleManager
(StyleManager styleManager) Sets the StyleManager object to be used by the Layer.void
setVerbose
(boolean verbose) Sets the verbose mode of the layer.void
setVisible
(boolean flag) Sets the visibility state of the layer.void
setVisible
(boolean flag, boolean fireEvent) Sets the visibility state of the layer.abstract LayerInfo
toString()
Returns the name of the current layer.void
Methods inherited from class com.kheops.jmap.metadata.LocalizedObject
getAvailableLocales, getTranslation, isTranslationExists, setTranslation, updateTranslations
-
Field Details
-
LAYER_ID_LABELS
public static final int LAYER_ID_LABELSThis constant refers to the reserved layer id for the layer containing the labels -
LAYER_ID_HIGHLIGHT
public static final int LAYER_ID_HIGHLIGHTThis constant refers to the reserved layer id for the layer containing highlight objects NOTE: different than SYS_DRAWINGS layer because the highlight tool constantly changes its location depending on the highlighted layer -
LAYER_ID_USER_DRAWINGS
public static final int LAYER_ID_USER_DRAWINGSSet the correct numbers for the constants below, and use constants instead of specifying the ID everywhere in JMap This constant refers to the reserved layer id for the layer containing the user drawings -
LAYER_ID_TMP_DRAWINGS
public static final int LAYER_ID_TMP_DRAWINGSThis constant refers to the reserved layer id for the layer containing the temporary drawings Ex: DistanceTool, temporary line drawn when the user moves the mouse 3D Distance/routing, possible route choices -
LAYER_ID_SYS_DRAWINGS
public static final int LAYER_ID_SYS_DRAWINGSThis constant refers to a reserved layer id used by drawing tools. -
LAYER_ID_USER_LABELS
public static final int LAYER_ID_USER_LABELSThis constant refers to a reserved layer id used for user layer labeling. -
LAYER_ID_INITIAL_VIEW_BOUNDS
public static final int LAYER_ID_INITIAL_VIEW_BOUNDSThis constant refers to a reserved layer id used by the administration extension. -
LAYER_ID_MARKERS
public static final int LAYER_ID_MARKERSThis constant refers to a reserved layer id used for the View Markers. -
DRAW_OPTIONS_SYNC
public static final int DRAW_OPTIONS_SYNCConstant used to specify that layer drawing should be done synchronously.- See Also:
-
DEFAULT_DRAW_STATE
-
id
protected int idThe id of the layer. -
name
The name of the layer. -
description
The description of the layer. -
elementType
protected int elementTypeThe type of elements this layer contains. -
layerProperties
protected long layerPropertiesLayer properties are stored as bitwise values in this property. -
readOnlyProperties
protected long readOnlyProperties -
maximumVisibleScale
protected double maximumVisibleScale -
minimumVisibleScale
protected double minimumVisibleScale -
styleManager
-
eventDispatcher
-
lastUpdateTime
protected long lastUpdateTime -
elementFactory
-
infoReportConfig
-
verbose
protected boolean verbose -
drawState
-
precisionModel
-
metadataUrl
-
dynamicRefresh
protected int dynamicRefresh
-
-
Constructor Details
-
Layer
protected Layer()Empty constructor. Useful for subclasses. -
Layer
Creates a new Layer using the specified parameters.
The new layer will be configured with only one tile with an infinite size.- Parameters:
id
- the id of the new layer.name
- the name.elementType
- the element type.
-
Layer
Deprecated.Creates a new Layer using the specified parameters.
The new layer will be configured with one infinite tile.- Parameters:
id
- the id of the new layer.geometryType
- the geometry type.elementType
- the element type.name
- the name.isVisible
- whether this layer is visible.
-
Layer
Initializes the new layer using the specified JMapClientLayerInfo.- Parameters:
layerInfo
- the new layer configuration.
-
-
Method Details
-
getNextUserLayerId
public static int getNextUserLayerId() -
getNextSystemLayerId
public static int getNextSystemLayerId() -
isProjectLayerId
public static boolean isProjectLayerId(int layerId) -
isSystemLayerId
public static boolean isSystemLayerId(int layerId) -
isReservedLayerId
public static boolean isReservedLayerId(int layerId) -
isUserLayerId
public static boolean isUserLayerId(int layerId) -
isPersonalLayerId
public static boolean isPersonalLayerId(int layerId) -
initEventDispatcher
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbose mode of the layer.- Parameters:
verbose
- the verbose mode
-
getVerbose
public boolean getVerbose()Returns whether the verbose mode is enabled.- Returns:
- the verbose mode.
-
setProperty
public final void setProperty(long property, boolean enabled) Sets the state for the specified property.- Specified by:
setProperty
in interfaceILayer
- Parameters:
property
- the property to set.enabled
- the property state.
-
setReadOnlyProperty
public final void setReadOnlyProperty(long property, boolean isReadOnly) Sets the read-only state for the specified property.- Specified by:
setReadOnlyProperty
in interfaceILayer
- Parameters:
property
- the property to set.isReadOnly
- the read-only state.
-
getReadOnlyProperties
public long getReadOnlyProperties()Returns the a mask which contains all read-only properties for this layer.- Specified by:
getReadOnlyProperties
in interfaceILayer
- Returns:
- the mask which defines read-only properties of the layer.
-
setReadOnlyProperties
public void setReadOnlyProperties(long value) Sets all read-only properties for the layer.- Specified by:
setReadOnlyProperties
in interfaceILayer
- Parameters:
value
- a bitwise value that contains all read-only layer properties.
-
getLayerProperties
public long getLayerProperties()Returns a bitwise value that contains all layer properties.- Specified by:
getLayerProperties
in interfaceILayer
- Returns:
- a value that contains all layer properties.
-
setLayerProperties
public void setLayerProperties(long value) Sets all layer properties.- Specified by:
setLayerProperties
in interfaceILayer
- Parameters:
value
- a bitwise value that contains all layer properties.
-
getLastUpdateTime
public long getLastUpdateTime()Gets the last updated time- Specified by:
getLastUpdateTime
in interfaceILayer
- Returns:
- the time of the last update
-
setLastUpdateTime
public void setLastUpdateTime(long lastUpdateTime) Sets the last updated time- Specified by:
setLastUpdateTime
in interfaceILayer
- Parameters:
lastUpdateTime
- the last updated time
-
addLayerEventListener
Added the specified listener to the layer listeners list.- Parameters:
listener
- the listener to add.
-
removeLayerEventListener
Removes the specified listener from the layer listeners list.- Parameters:
listener
- the listener to remove.
-
isDrawable
public boolean isDrawable(double scale) Returns true if this layer should be drawn at the specified scale. This is based on the minimum and maximum zoom scales stored in the style of this layer.- Parameters:
scale
- the scale used for the calculation.- Returns:
- true if this layer should be drawn at the specified scale.
-
getName
Returns the name of the layer. -
getName
Returns the name of this layer for a specific locale. -
isNamed
Checks if the layer is named (including available translations, case insensitive) as the specified value.- Parameters:
value
-- Returns:
-
getDescription
Returns the description of the layer.- Specified by:
getDescription
in interfaceILayer
- Returns:
- the description of the layer
-
getDescription
Returns the description of this layer for a specific locale.- Specified by:
getDescription
in interfaceILayer
- Parameters:
locale
-- Returns:
- description.
-
setDescription
Sets the description string for the layer.- Specified by:
setDescription
in interfaceILayer
- Parameters:
description
- the description string
-
setDescription
Sets the description of this layer for the specified Locale.- Specified by:
setDescription
in interfaceILayer
- Parameters:
description
- the new given description.locale
- the locale for this description
-
getId
public int getId()Returns the id of the layer. -
setId
public void setId(int id) Sets the id of the layer. -
setVisible
public void setVisible(boolean flag) Sets the visibility state of the layer. If a layer is invisible, it is not drawn in a view.- Specified by:
setVisible
in interfaceILayer
- Specified by:
setVisible
in interfaceLayerNode
- Parameters:
flag
- if true, the layer will be visible otherwise invisible
-
setVisible
public void setVisible(boolean flag, boolean fireEvent) Sets the visibility state of the layer. If a layer is invisible, it is not drawn in a view.- Parameters:
flag
- if true, the layer will be visible otherwise invisiblefireEvent
- if true, firePropertyChangedEvent and fireVisibilityEvent are fired
-
isVisible
public boolean isVisible()Returns the current visibility state of the layer -
setQueriable
Deprecated.As of release 4.0, the QUERIABLE property is not used anymoreSets the queriable state of the layer. Tools can check this state using the method isQueriable to determine if this layer should be processed.- Parameters:
flag
- if true, the layer will be queriable otherwise not queriable
-
isQueriable
Deprecated.As of release 4.0, the QUERIABLE property is not used anymoreReturns the current queriable state of the layer.- Returns:
- true if the layer is queriable, false otherwise
-
setSelectable
public void setSelectable(boolean flag) Sets the selectable state of the layer. Selection tools can check this state using the method getSelectable to determine if this layer should be processed.- Specified by:
setSelectable
in interfaceILayer
- Parameters:
flag
- if true, the layer will be selectable otherwise not selectable
-
isSelectable
public boolean isSelectable()Returns the current selectable state of the layer.- Specified by:
isSelectable
in interfaceILayer
- Returns:
- true if the layer is selectable, false otherwise
-
setLocal
public void setLocal(boolean flag) Sets the local state of the layer. A local layer is generated on the client side and therefore should not generate data requests to the server. -
isLocal
public boolean isLocal()Returns the current local state of the layer. -
setListed
public void setListed(boolean listed) Sets the listed state of the layer. This flag can be used to determine if the layer should be hidden to the user in a list of layers. -
isListed
public boolean isListed()Returns the current listed state of the layer. -
setIncludeInContext
public void setIncludeInContext(boolean includeInContext) Sets whether this layer should be included in contexts.- Parameters:
includeInContext
- true defines that this layer should be included in contexts.
-
isIncludeInContext
public boolean isIncludeInContext()Returns whether this layer should be included in contexts.- Returns:
- true if this layer should be included in contexts.
-
drawGrid
public boolean drawGrid()Returns the draw grid state.- Returns:
- true is the layer grid is drawn
-
setDrawGrid
public void setDrawGrid(boolean drawGrid) Sets the draw grid state.- Parameters:
drawGrid
- if true, the grid will be drawn
-
isIndex
public boolean isIndex()Returns whether this layer should be drawn in the client overview. -
setIndex
public void setIndex(boolean flag) Sets whether this layer should be drawn in the client overview. -
getStyle
Returns the default style object associated with the layer.
Note: If this layer has more than one style (depending on the zoom level), the lowest level style is returned.- Returns:
- the default style of the layer
- See Also:
-
getStyle
Returns the style object associated with the layer (used to draw elements of the layer).- Parameters:
scale
- the scale of the current View.- Returns:
- the default style of the layer.
- See Also:
-
getSelectionStyle
Returns the default selection style object associated with the layer.
Note: If this layer has more than one style (depending on the zoom level), the lowest level selection style is returned.- Returns:
- the default selection style of the layer
- See Also:
-
getSelectionStyle
Returns the selection style object associated with the layer for the specified scale.- Parameters:
scale
- the scale of the current View.- Returns:
- the selection style of the layer for the specified scale.
- See Also:
-
setStyle
Deprecated.since JMap 2.5Sets the default style for this layer. Fires a LayerStyleReplacedEvent.- Parameters:
style
- the new default style for the layer- See Also:
-
setStyleManager
Sets the StyleManager object to be used by the Layer.- Specified by:
setStyleManager
in interfaceILayer
- Parameters:
styleManager
- the style manager to be used.
-
getStyleManager
Returns the StyleManager instance used by the Layer.- Specified by:
getStyleManager
in interfaceILayer
- Returns:
- the StyleManager instance used by the Layer.
-
setStyle
Sets the default style at the specified scale for this layer. Fires a LayerStyleChangedEvent.- Parameters:
style
- the new default style for the layerscale
- the scale of the Style to replace.- See Also:
-
fireStyleChangedEvent
protected void fireStyleChangedEvent() -
getRequestMode
public abstract int getRequestMode()Returns the request mode for this layer. The request mode can be either by tile (REQUEST_MODE_TILE) or by random region (REQUEST_MODE_REGION). When using requests by tile, predimensionned tiles are exchanged between JMapServer and the client application. When using requests by region, random regions of data are exchanged depending on the region the user is viewing. Requests by tiles are generally more performant because they allow caching on the server and client sides. Requests by region are useful when data must always be up-to-date, as it will be requested each time from the spatial data source.- Returns:
- the current request mode in use by this layer.
-
getExtent
Returns the extent of the layer. -
drawGrid
Draws the tile grid for the layer.- Parameters:
gr
- the Graphics wrapper object used to draw the gridt
- the 2D transformation matrix used to draw the grid
-
draw
@Deprecated public void draw(GraphicsRef gr, ViewState vs, OrientedRectangle region, double scale, int drawOptions) Deprecated.Draws layer contained in the specified region to the specified graphics object and applying the specified transformation.- Parameters:
gr
- the graphics wrapper object to use.vs
- the view state that provides context information to draw the layer.region
- the world coordinate region to redraw.scale
- the scale of the current View.drawOptions
- draw options to use. Options can be retrieved with bitwise operations usingLayerManager.DRAW_*
constants.- See Also:
-
draw
public abstract void draw(GraphicsRef gr, ViewState vs, OrientedRectangle region, double scale, DrawParameters parameters) Draws layer contained in the specified region to the specified graphics object and applying the specified transformation.- Parameters:
gr
- the graphics wrapper object to use.vs
- the view state that provides context information to draw the layer.region
- the world coordinate region to redraw.scale
- the scale of the current View.parameters
- draw parameters.- Since:
- 7.0
-
close
public abstract void close()Frees all resources used by the layer. -
dispatchEvent
ThedispatchEvent
method is used to dispatch synchronously JMap events to all registered listeners. The main use of theJMapEventDispatcher
interface is to dispatch events that were previously added to the JMap event queue.
Note: onlyLayerEvent
will be accepted by this method. Any other JMap event types will cause the layer to throw an exception.- Specified by:
dispatchEvent
in interfaceJMapEventDispatcher
- Parameters:
event
- the event to be dispatched.- Throws:
IllegalArgumentException
- will be thrown if theJMapEvent
instance is no an instance of theLayerEvent
class.- See Also:
-
fireLayerReceivedDataEvent
-
fireRefreshRequestEvent
protected void fireRefreshRequestEvent()Fires refresh request event so that the listener can handle the event properly -
fireLayerPropertyChangedEvent
protected void fireLayerPropertyChangedEvent(byte property) -
fireLayerPropertyBeforeChangeEvent
protected void fireLayerPropertyBeforeChangeEvent(byte property) -
setMinimumVisibleScale
public void setMinimumVisibleScale(double scale) Sets the minimum scale at which the layer should be visible.- Specified by:
setMinimumVisibleScale
in interfaceILayer
- Parameters:
scale
- the minimum scale limit for the layer
-
getMinimumVisibleScale
public double getMinimumVisibleScale()Gets the minimum scale at which the layer should be visible.- Specified by:
getMinimumVisibleScale
in interfaceILayer
- Returns:
- the minimum scale limit for the layer
-
setMaximumVisibleScale
public void setMaximumVisibleScale(double scale) Sets the maximum scale at which the layer should be visible.- Specified by:
setMaximumVisibleScale
in interfaceILayer
- Parameters:
scale
- the maximum scale limit for the layer
-
getMaximumVisibleScale
public double getMaximumVisibleScale()Gets the maximum scale at which the layer should be visible.- Specified by:
getMaximumVisibleScale
in interfaceILayer
- Returns:
- the maximum scale limit for the layer
-
setName
Sets the layer name. -
setName
Sets the name of this layer for the specified Locale. -
getElementFactory
Returns the K2DElementFactory configured for the layer.- Specified by:
getElementFactory
in interfaceILayer
- Returns:
- the current K2DElementFactory of the layer.
-
setElementFactory
Sets the K2DElementFactory to be used by this layer.- Specified by:
setElementFactory
in interfaceILayer
- Parameters:
elementFactory
- the K2DElementFactory to use.
-
getElementType
public int getElementType()Returns the layer element type.- Specified by:
getElementType
in interfaceILayer
- Returns:
- the element type.
- See Also:
-
setElementType
public void setElementType(int elementType) Sets the layer element type.- Specified by:
setElementType
in interfaceILayer
- Parameters:
elementType
- the element type to set.- See Also:
-
getInfoReportConfig
Return the information report configuration of the layer.- Specified by:
getInfoReportConfig
in interfaceILayer
- Returns:
- the layer information report configuration.
-
setInfoReportConfig
Sets the information report configuration of the layer.- Specified by:
setInfoReportConfig
in interfaceILayer
- Parameters:
infoReportConfig
- the infoReportConfig to set.
-
toString
Returns the name of the current layer. -
compareTo
Compares this object with the specified layer for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.It implements the compareTo from the Comparable interface If the object is null, the method returns -1
- Specified by:
compareTo
in interfaceComparable<Layer>
- Parameters:
layer
- the layer to compare to.- Returns:
- the corresponding integer value
- See Also:
-
clone
Description copied from interface:ILayer
Returns a deep clone of the current LayerInfo instance. -
clone
Implementation of the clone method.- Parameters:
layer
- the new layer instance.
-
update
-
toLayerInfo
-
loadData
This method automatically loads the data intersecting with the specified geometry. For now, it is only implemented for VectorLayer, where it will load the intersecting tiles.- Parameters:
bounds
- the geometry used to delimit the boundssync
- whether his method is synchronized
-
invalidate
public void invalidate()Invalidates the cached data for vector and raster layers. Consequently, cached data will be discarded and reloaded at the next view drawing.
Since 6.5, this method also affects layers loaded by tiles. Note that for tiled layers, calling the layer's invalidate method will not invalidate the local disk cache. To invalidate the local disk cache, the invalidateLayer method of the LayerManager must be called.- Since:
- 4.0.2
-
revalidate
Revalidates cached data based on the specified affine transformation.- Parameters:
tr
- the transformation to set. If null is specified, this method has the same effect as theinvalidate()
method.- Since:
- 4.0.2
-
setPrecisionModel
Sets the precision model to use for geometrical operations.- Parameters:
precisionModel
- the precision model to use.- Since:
- 4.0.3
-
getPrecisionModel
Returns the precision model to use for geometrical operations.- Returns:
- the precision model to use for geometrical operations.
- Since:
- 4.0.3
-
getMetadataUrl
Returns the metadata URL.- Specified by:
getMetadataUrl
in interfaceILayer
- Returns:
- metadata URL
- Since:
- 4.0.3
-
setMetadataUrl
Sets the metadata URL.- Specified by:
setMetadataUrl
in interfaceILayer
- Parameters:
metadataUrl
- the metadata URL- Since:
- 4.0.3
-
isDynamic
public boolean isDynamic() -
getDynamicRefresh
public int getDynamicRefresh()Gets the time at which a layer is automatically refreshed- Specified by:
getDynamicRefresh
in interfaceILayer
- Returns:
- the time in seconds
-
setDynamicRefresh
public void setDynamicRefresh(int seconds) Sets the time at which a layer is automatically refreshed. A zero or negative value indicates that the layer is not dynamic.- Specified by:
setDynamicRefresh
in interfaceILayer
- Parameters:
seconds
-
-
removeTranslationsOtherThan
Description copied from class:LocalizedObject
Removes anyLocale
from this object that are not in the specifiedlocales
.locales[0]
should be the default language- Overrides:
removeTranslationsOtherThan
in classLocalizedObject
- Parameters:
locales
-
-
draw(GraphicsRef, ViewState, OrientedRectangle, double, DrawParameters)
instead.