|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.map.Layer com.esri.map.GroupLayer com.esri.map.KMLLayer
public class KMLLayer
The KMLLayer class represents a layer based on a KML file (.kml,.kmz). KML is an XML tag based syntax that holds geographic information (geometric shapes, symbology, and attributes) in a file with the .kml extension.
To add a KML file(.kml or .kmz) to a map, the KML must be available via a publicly accessible URL.
Locally hosted or KML files inside a firewall are not supported.
KML Layer is a group layer which is made up of several layers in order to support wide range of feature types that can be stored in a KML file.
Geometries from a KML file are stored as feature layers: one each for points, lines and polygons. The feature layer can be accessed by iterating the children of the GroupLayer
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.esri.map.Layer |
---|
Layer.LayerStatus |
Field Summary | |
---|---|
protected List<Layer> |
innerLayers
|
Fields inherited from class com.esri.map.Layer |
---|
_credentials, _progress, _resolutionList, serviceInfo |
Constructor Summary | |
---|---|
KMLLayer(String url)
The constructor is used if you are instantiating a KMLLayer using a publicly accessible URL. |
|
KMLLayer(String url,
SpatialReference outSR)
The constructor is used if you are instantiating a KMLLayer using a URL and output spatial reference. |
Method Summary | |
---|---|
boolean |
contains(Layer layer)
|
protected void |
createNativeLayer()
|
protected boolean |
doesExist(com.esri.map.GroupLayerBase grouplayer,
Layer checklayer)
|
protected void |
finalize()
|
Layer |
get(int index)
Returns the layer for the given index position. |
SpatialReference |
getDefaultSpatialReference()
Gets the defaultSpatialReference of the Layer. |
Envelope |
getFullExtent()
Returns the full extent of the layer. |
long |
getID()
Return the Layer runtime ID which is a long integer. |
Layer |
getLayer(String layername)
Returns the layer for the given layer name. |
Layer[] |
getLayers()
Returns the direct sublayers in an array. |
LayerLegendInfoCollection |
getLegend()
|
double |
getMaxScale()
Gets the maximum scale at which this layer will be displayed. |
double |
getMinScale()
Gets the minimum scale at which this layer will be displayed. |
protected void |
graphicsLayerAddRequest(String layerName,
int index)
|
protected void |
init(boolean isVisible,
int[] visibleLayers,
String title,
float opacity)
This method is called only when composing a Map from a Web Map. |
protected void |
initializeNativeLayer()
|
protected int |
internalAdd(Layer layer)
|
protected boolean |
internalAddLayerAt(Layer layer,
int index)
|
protected void |
internalInit()
|
boolean |
isEmpty()
|
boolean |
isInitialized()
|
void |
recycle()
Releases resources referenced by the Layer so that they can be recycled. |
protected void |
recycleLayers()
|
void |
refresh()
Refreshes the KML layer by downloading and parsing the KML document. |
protected void |
setDefaultSpatialReference(SpatialReference defaultSpatialReference)
Sets the defaultSpatialReference of the Layer. |
protected void |
setMap(JMap parent)
Every layer is provided a reference to the parent JComponent that contains that layer. |
void |
setOpacity(float opacity)
Sets the opacity of the GroupLayer, it will change all opacity of it sublayers. |
void |
setVisible(boolean visible)
Sets the visibility of the Layer. |
int |
size()
Returns the size of the group layer. |
protected void |
updateSpatialReferenceStatus(int SRStatus)
|
Methods inherited from class com.esri.map.GroupLayer |
---|
add, addAll, addLayerAt, clear, remove, remove |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final List<Layer> innerLayers
Constructor Detail |
---|
public KMLLayer(String url)
url
- string URL to the KML file.public KMLLayer(String url, SpatialReference outSR)
url
- string URL to the KML file.outSR
- output spatial reference.Method Detail |
---|
protected void updateSpatialReferenceStatus(int SRStatus)
updateSpatialReferenceStatus
in class Layer
public void refresh()
protected void internalInit()
public boolean isInitialized()
isInitialized
in class Layer
public void setVisible(boolean visible)
Layer
setVisible
in class Layer
visible
- The visibility to set.public void recycle()
Layer
public Layer[] getLayers()
public Layer getLayer(String layername)
layername
- a layer name string
public Layer get(int index)
index
- an integer for layer position.
public boolean isEmpty()
public boolean contains(Layer layer)
public int size()
public void setOpacity(float opacity)
setOpacity
in class Layer
opacity
- the opacity to set.public Envelope getFullExtent()
getFullExtent
in class Layer
public SpatialReference getDefaultSpatialReference()
getDefaultSpatialReference
in class Layer
public long getID()
public double getMinScale()
Layer
getMinScale
in class Layer
public double getMaxScale()
Layer
getMaxScale
in class Layer
public LayerLegendInfoCollection getLegend()
getLegend
in class Layer
protected void setDefaultSpatialReference(SpatialReference defaultSpatialReference)
setDefaultSpatialReference
in class Layer
defaultSpatialReference
- The defaultSpatialReference to set.protected int internalAdd(Layer layer)
layer
-
protected boolean internalAddLayerAt(Layer layer, int index)
layer
- index
-
protected boolean doesExist(com.esri.map.GroupLayerBase grouplayer, Layer checklayer)
protected void recycleLayers()
protected void graphicsLayerAddRequest(String layerName, int index)
protected void finalize() throws Throwable
finalize
in class Layer
Throwable
protected void init(boolean isVisible, int[] visibleLayers, String title, float opacity)
Layer
init
in class Layer
protected void createNativeLayer()
createNativeLayer
in class Layer
protected void initializeNativeLayer()
initializeNativeLayer
in class Layer
protected void setMap(JMap parent)
Layer
setMap
in class Layer
parent
- the new parent component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |