public class MapLayer extends Object
Please note that not all Layer implementations support Query and/or Style.
Modifier and Type | Field and Description |
---|---|
protected Layer |
internal
Deprecated.
This is the internal delegate
|
Constructor and Description |
---|
MapLayer(CollectionSource source,
Style style,
String title)
Deprecated.
|
MapLayer(Collection collection,
Style style)
Deprecated.
|
MapLayer(Collection collection,
Style style,
String title)
Deprecated.
|
MapLayer(FeatureCollection collection,
Style style)
Deprecated.
Creates a new instance of DefaultMapLayer using a non-emtpy feature collection as a parameter
|
MapLayer(FeatureCollection collection,
Style style,
String title)
Deprecated.
Creates a new instance of DefaultMapLayer using a non-emtpy feature collection as a parameter
|
MapLayer(FeatureSource featureSource,
Style style)
Deprecated.
Creates a new instance of DefaultMapLayer
|
MapLayer(FeatureSource featureSource,
Style style,
String title)
Deprecated.
Creates a new instance of DefaultMapLayer
|
MapLayer(GridCoverage2DReader reader,
Style style)
Deprecated.
Constructor which adds a new layer and triggers a
LayerListEvent . |
MapLayer(GridCoverage2DReader reader,
Style style,
String title)
Deprecated.
Constructor which adds a new layer and trigger a
LayerListEvent . |
MapLayer(GridCoverage2DReader reader,
Style style,
String title,
GeneralParameterValue[] params)
Deprecated.
Constructor which adds a new layer and trigger a
LayerListEvent . |
MapLayer(GridCoverage coverage,
Style style)
Deprecated.
* Add a new layer and trigger a
LayerListEvent . |
MapLayer(GridCoverage coverage,
Style style,
String title)
Deprecated.
* Add a new layer and trigger a
LayerListEvent . |
MapLayer(Layer layer)
Deprecated.
Wrap up a layer in a DefaultMapLayer; generally used to ensure layer is shown to the world as
a feature source even if it happens to be a WMS or something.
|
Modifier and Type | Method and Description |
---|---|
void |
addMapLayerListener(MapLayerListener listener)
Deprecated.
Registers MapLayerListener to receive events.
|
boolean |
equals(Object obj)
Deprecated.
Equals based on internal layer
|
ReferencedEnvelope |
getBounds()
Deprecated.
find out the bounds of the layer
|
FeatureSource |
getFeatureSource()
Deprecated.
Get the feature collection for this layer; if available.
|
Query |
getQuery()
Deprecated.
Returns the definition query (filter) for this layer.
|
CollectionSource |
getSource()
Deprecated.
Get the data source for this layer.
|
Style |
getStyle()
Deprecated.
Get the style for this layer.
|
String |
getTitle()
Deprecated.
Get the title of this layer.
|
int |
hashCode()
Deprecated.
Hashcode based on internal Layer
|
boolean |
isSelected()
Deprecated.
Determine whether this layer is currently selected.
|
boolean |
isVisible()
Deprecated.
Determine whether this layer is visible on a map pane or whether the layer is hidden.
|
void |
removeMapLayerListener(MapLayerListener listener)
Deprecated.
Removes MapLayerListener from the list of listeners.
|
void |
setQuery(Query query)
Deprecated.
Sets a definition query for the layer which acts as a filter for the features that the layer
will draw.
|
void |
setSelected(boolean selected)
Deprecated.
Specify whether this layer is selected.
|
void |
setStyle(Style style)
Deprecated.
Sets the style for this layer.
|
void |
setTitle(String title)
Deprecated.
Set the title of this layer.
|
void |
setVisible(boolean visible)
Deprecated.
Specify whether this layer is visible on a map pane or whether the layer is hidden.
|
Layer |
toLayer()
Deprecated.
Access to raw layer object used for rendering.
|
String |
toString()
Deprecated.
|
protected Layer internal
public MapLayer(Layer layer)
public MapLayer(FeatureSource featureSource, Style style, String title)
featureSource
- the data source for this layerstyle
- the style used to represent this layertitle
- the layer titleNullPointerException
- DOCUMENT ME!public MapLayer(CollectionSource source, Style style, String title)
public MapLayer(FeatureSource featureSource, Style style)
featureSource
- the data source for this layerstyle
- the style used to represent this layerpublic MapLayer(FeatureCollection collection, Style style, String title)
collection
- the source feature collectionstyle
- the style used to represent this layertitle
- Title of map layerpublic MapLayer(Collection collection, Style style, String title)
public MapLayer(FeatureCollection collection, Style style)
collection
- the source feature collectionstyle
- the style used to represent this layerpublic MapLayer(Collection collection, Style style)
public MapLayer(GridCoverage coverage, Style style) throws TransformException, FactoryRegistryException, SchemaException
LayerListEvent
.coverage
- The new layer that has been added.style
- SchemaException
FactoryRegistryException
TransformException
public MapLayer(GridCoverage2DReader reader, Style style, String title, GeneralParameterValue[] params) throws TransformException, FactoryRegistryException, SchemaException
LayerListEvent
.reader
- a reader with the new layer that will be added.style
- title
- params
- GeneralParameterValue[] that describe how the AbstractGridCoverage2DReader
shall read the imagesSchemaException
FactoryRegistryException
TransformException
public MapLayer(GridCoverage2DReader reader, Style style, String title)
LayerListEvent
.reader
- a reader with the new layer that will be added.style
- title
- SchemaException
FactoryRegistryException
TransformException
public MapLayer(GridCoverage2DReader reader, Style style)
LayerListEvent
.reader
- a reader with the new layer that will be addedstyle
- SchemaException
FactoryRegistryException
TransformException
public MapLayer(GridCoverage coverage, Style style, String title) throws TransformException, FactoryRegistryException, SchemaException
LayerListEvent
.coverage
- The new layer that has been added.style
- title
- SchemaException
FactoryRegistryException
TransformException
public Layer toLayer()
public FeatureSource getFeatureSource()
public CollectionSource getSource()
FeatureSource
is usedpublic Style getStyle()
public void setStyle(Style style)
style
- The new stylepublic String getTitle()
public void setTitle(String title)
LayerEvent
is fired if the new title is different from
the previous one.title
- The title of this layer.public boolean isVisible()
true
if the layer is visible, or false
if the layer is
hidden.public void setVisible(boolean visible)
LayerEvent
is fired if the visibility changed.visible
- Show the layer if true
, or hide the layer if false
public boolean isSelected()
true
if the layer is selected, or false
otherwisepublic void setSelected(boolean selected)
LayerEvent
iw fired if the selected status
is changed.selected
- Set the layer as selected if true
or as unselected if
false
public Query getQuery()
Query.ALL
is returned.Query.ALL
, if set, returns a copy of the actual query object to avoid external
modificationpublic void setQuery(Query query)
A consumer must ensure that this query is used in combination with the bounding box filter generated on each map interaction to limit the number of features returned to those that complains both the definition query and relies inside the area of interest.
IMPORTANT: only include attribute names in the query if you want them to be ALWAYS returned. It is desirable to not include attributes at all but let the renderer decide which attributes are actually needed to perform its required operation.
WARNING: We do not check if your query is suitable for the layer FeatureSource
you
may accidentally return no features; resulting in an "empty" layer.
query
- the full filter for this layer.NullPointerException
- if no query is passed on. If you want to reset a definition
query, pass it Query.ALL
instead of null
FeatureLayer.setQuery(org.geotools.data.Query)
public ReferencedEnvelope getBounds()
public void addMapLayerListener(MapLayerListener listener)
listener
- The listener to register.public void removeMapLayerListener(MapLayerListener listener)
listener
- The listener to remove.public int hashCode()
public boolean equals(Object obj)
Copyright © 1996–2019 Geotools. All rights reserved.