public class KMLRoot extends KMLAbstractObject implements KMLRenderable
gov.nasa.worldwind.ogc.kml
.Modifier and Type | Field and Description |
---|---|
protected AbsentResourceList |
absentResourceList |
protected double |
detailHint
Indicates this KML root's detail hint.
|
protected javax.xml.stream.XMLEventReader |
eventReader
The event reader used to parse the document's XML.
|
protected java.io.InputStream |
eventStream
The input stream underlying the event reader.
|
protected KMLAbstractFeature |
feature |
protected boolean |
featureFetched
Flag to indicate that the feature has been fetched from the hash map.
|
protected KMLDoc |
kmlDoc
Reference to the KMLDoc representing the KML or KMZ file.
|
protected boolean |
linkControlFetched
Flag to indicate that the network link control element has been fetched from the hash map.
|
protected KMLNetworkLinkControl |
networkLinkControl |
protected KMLParserContext |
parserContext
The parser context for the document.
|
protected java.beans.PropertyChangeSupport |
propertyChangeSupport
The
PropertyChangeSupport that receives property change events this KMLRoot listens for, and sends
property change events to this KMLRoot's listeners. |
MSG_BOX_CHANGED, MSG_GEOMETRY_CHANGED, MSG_LINK_CHANGED, MSG_STYLE_CHANGED, MSG_TIME_CHANGED, MSG_VIEW_CHANGED
CHARACTERS_CONTENT, fields, namespaceURI, parent
Constructor and Description |
---|
KMLRoot(java.io.File docSource)
Create a new
KMLRoot for a File . |
KMLRoot(java.io.File docSource,
boolean namespaceAware)
Create a new
KMLRoot for a File . |
KMLRoot(java.io.InputStream docSource,
java.lang.String contentType)
Create a new
KMLRoot for an InputStream . |
KMLRoot(java.io.InputStream docSource,
java.lang.String contentType,
boolean namespaceAware)
Create a new
KMLRoot for an InputStream . |
KMLRoot(KMLDoc docSource)
Create a new
KMLRoot for a KMLDoc instance. |
KMLRoot(KMLDoc docSource,
boolean namespaceAware)
Create a new
KMLRoot for a KMLDoc instance. |
KMLRoot(java.lang.String namespaceURI,
KMLDoc docSource)
Create a new
KMLRoot with a specific namespace. |
KMLRoot(java.lang.String namespaceURI,
KMLDoc docSource,
boolean namespaceAware)
Create a new
KMLRoot with a specific namespace. |
KMLRoot(java.net.URL docSource,
java.lang.String contentType)
Create a
KMLRoot for a URL . |
KMLRoot(java.net.URL docSource,
java.lang.String contentType,
boolean namespaceAware)
Create a
KMLRoot for a URL . |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the specified property change listener that will be called for all list changes.
|
protected boolean |
canParseContentType(java.lang.String mimeType)
Determines if a MIME type can be parsed as KML or KMZ.
|
protected void |
closeEventStream()
Closes the event stream associated with this context's XML event reader.
|
static KMLRoot |
create(java.lang.Object docSource)
Creates a KML root for an untyped source.
|
static KMLRoot |
create(java.lang.Object docSource,
boolean namespaceAware)
Creates a KML root for an untyped source.
|
static KMLRoot |
createAndParse(java.lang.Object docSource)
Creates a KML root for an untyped source and parses it.
|
protected KMLParserContext |
createParserContext(javax.xml.stream.XMLEventReader reader)
Invoked during
initialize(boolean) to create the parser context. |
protected javax.xml.stream.XMLEventReader |
createReader(java.lang.Object docSource,
boolean namespaceAware)
Creates the event reader.
|
void |
evictIfExpired(java.lang.String link,
long expirationTime)
Check a cached resource for expiration.
|
protected KMLAbstractFeature |
findFeature()
Searches this root's fields for the KML Feature element.
|
void |
firePropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
Fire a property change event.
|
void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Fire a property change event.
|
protected java.beans.PropertyChangeSupport |
getChangeSupport()
Get the PropertyChangeSupport object for this KML object.
|
double |
getDetailHint()
Indicates this KML root's detail hint, which is described in
. |
long |
getExpiration(java.lang.String link)
Returns the expiration time of a file retrieved by
resolveReference or resolveNetworkLink . |
KMLAbstractFeature |
getFeature()
Returns the KML
Feature element contained in the document root. |
java.lang.String |
getHint()
Returns the
hint attribute of the KML element (the document root). |
java.lang.Object |
getItemByID(java.lang.String id)
Finds a named element in the document.
|
KMLDoc |
getKMLDoc()
Returns the KML document for this
KMLRoot . |
KMLNetworkLinkControl |
getNetworkLinkControl()
Returns the
KMLNetworkLinkControl element if the document root contains it. |
protected XMLEventParserContext |
getParserContext() |
java.lang.String |
getSupportFilePath(java.lang.String link) |
protected void |
initialize(boolean namespaceAware)
Called just before the constructor returns.
|
void |
onMessage(Message msg)
Invoked when a message is received.
|
KMLRoot |
parse(java.lang.Object... args)
Starts document parsing.
|
protected KMLRoot |
parseCachedKMLFile(java.net.URL url,
java.lang.String linkBase,
java.lang.String contentType,
boolean namespaceAware)
Open and parse the specified file expressed as a file: URL..
|
void |
preRender(KMLTraversalContext tc,
DrawContext dc)
Pre-render this element.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified property change listener.
|
void |
render(KMLTraversalContext tc,
DrawContext dc)
Render this element.
|
void |
requestRedraw()
Request any scene containing this KML document be repainted.
|
java.lang.Object |
resolveLocalReference(java.lang.String linkBase,
java.lang.String linkRef)
Resolves a reference to a local element identified by address and identifier, where
linkBase identifies a
document, including the current document, and linkRef is the id of the desired element. |
java.lang.Object |
resolveNetworkLink(java.lang.String link,
boolean cacheRemoteFile,
long updateTime)
Resolves a NetworkLink to a local or remote KML document.
|
java.lang.Object |
resolveReference(java.lang.String link)
Resolves a reference to a remote or local element of the form address#identifier, where "address" identifies a
local or remote document, including the current document, and and "identifier" is the id of the desired element.
|
java.lang.Object |
resolveReference(java.lang.String link,
boolean cacheRemoteFile)
Resolves a reference to a remote or local element of the form address#identifier, where "address" identifies a
local or remote document, including the current document, and and "identifier" is the id of the desired element.
|
java.lang.Object |
resolveRemoteReference(java.lang.String linkBase,
java.lang.String linkRef)
Resolves a reference to a remote element identified by address and identifier, where
linkBase identifies
a remote document, and linkRef is the id of the desired element. |
java.lang.Object |
resolveRemoteReference(java.lang.String linkBase,
java.lang.String linkRef,
boolean cacheRemoteFile)
Resolves a reference to a remote element identified by address and identifier, where
linkBase identifies
a remote document, and linkRef is the id of the desired element. |
void |
setDetailHint(double detailHint)
Specifies this KML root's detail hint.
|
void |
setNotificationListener(XMLParserNotificationListener listener)
Specifies the object to receive notifications of important occurrences during parsing, such as exceptions and the
occurrence of unrecognized element types.
|
applyChange, getId, getRoot, getTargetId, onChange
allocate, doAddCharacters, doAddEventAttribute, doAddEventContent, doParseEventAttributes, doParseEventContent, freeResources, getAConstructor, getCharacters, getField, getField, getFields, getNamespaceURI, getParent, hasField, hasField, hasFields, mergeFields, newInstance, overrideFields, parse, parseCharacterContent, removeField, setField, setField, setFields, setNamespaceURI, setParent
protected AbsentResourceList absentResourceList
protected double detailHint
protected javax.xml.stream.XMLEventReader eventReader
protected java.io.InputStream eventStream
protected KMLAbstractFeature feature
protected boolean featureFetched
protected KMLDoc kmlDoc
protected boolean linkControlFetched
protected KMLNetworkLinkControl networkLinkControl
protected KMLParserContext parserContext
protected java.beans.PropertyChangeSupport propertyChangeSupport
PropertyChangeSupport
that receives property change events this KMLRoot listens for, and sends
property change events to this KMLRoot's listeners. Lazily initialized in getChangeSupport
.
Initially null
.public KMLRoot(java.io.File docSource) throws java.io.IOException
KMLRoot
for a File
.docSource
- the File containing the document.java.lang.IllegalArgumentException
- if the document source is null.java.io.IOException
- if an error occurs while reading the KML document.public KMLRoot(java.io.File docSource, boolean namespaceAware) throws java.io.IOException
KMLRoot
for a File
.docSource
- the File containing the document.namespaceAware
- specifies whether to use a namespace-aware XML parser. true
if so,
false
if not.java.lang.IllegalArgumentException
- if the document source is null.java.io.IOException
- if an error occurs while reading the KML document.public KMLRoot(java.io.InputStream docSource, java.lang.String contentType) throws java.io.IOException
KMLRoot
for an InputStream
.docSource
- the input stream containing the document.contentType
- the content type of the stream data. Specify KMLConstants.KML_MIME_TYPE
for plain KML
and KMLConstants.KMZ_MIME_TYPE
for KMZ. The content is treated as KML for any other
value or a value of null.java.lang.IllegalArgumentException
- if the document source is null.java.io.IOException
- if an error occurs while reading the KML document.public KMLRoot(java.io.InputStream docSource, java.lang.String contentType, boolean namespaceAware) throws java.io.IOException
KMLRoot
for an InputStream
.docSource
- the input stream containing the document.contentType
- the content type of the stream data. Specify KMLConstants.KML_MIME_TYPE
for plain
KML and KMLConstants.KMZ_MIME_TYPE
for KMZ. The content is treated as KML for any
other value or a value of null.namespaceAware
- specifies whether to use a namespace-aware XML parser. true
if so,
false
if not.java.lang.IllegalArgumentException
- if the document source is null.java.io.IOException
- if an error occurs while reading the KML document.public KMLRoot(KMLDoc docSource) throws java.io.IOException
KMLRoot
for a KMLDoc
instance. A KMLDoc represents KML and KMZ files from
either files or input streams.docSource
- the KMLDoc instance representing the KML document.java.lang.IllegalArgumentException
- if the document source is null.java.io.IOException
- if an error occurs while reading the KML document.public KMLRoot(KMLDoc docSource, boolean namespaceAware) throws java.io.IOException
KMLRoot
for a KMLDoc
instance. A KMLDoc represents KML and KMZ files from
either files or input streams.docSource
- the KMLDoc instance representing the KML document.namespaceAware
- specifies whether to use a namespace-aware XML parser. true
if so,
false
if not.java.lang.IllegalArgumentException
- if the document source is null.java.io.IOException
- if an error occurs while reading the KML document.public KMLRoot(java.lang.String namespaceURI, KMLDoc docSource) throws java.io.IOException
KMLRoot
with a specific namespace. (The default namespace is defined by KMLConstants.KML_NAMESPACE
).namespaceURI
- the default namespace URI.docSource
- the KML source specified via a KMLDoc
instance. A KMLDoc represents KML and KMZ files
from either files or input streams.java.lang.IllegalArgumentException
- if the document source is null.java.io.IOException
- if an I/O error occurs attempting to open the document source.public KMLRoot(java.lang.String namespaceURI, KMLDoc docSource, boolean namespaceAware) throws java.io.IOException
KMLRoot
with a specific namespace. (The default namespace is defined by KMLConstants.KML_NAMESPACE
).namespaceURI
- the default namespace URI.docSource
- the KML source specified via a KMLDoc
instance. A KMLDoc represents KML and KMZ
files from either files or input streams.namespaceAware
- specifies whether to use a namespace-aware XML parser. true
if so,
false
if not.java.lang.IllegalArgumentException
- if the document source is null.java.io.IOException
- if an I/O error occurs attempting to open the document source.public KMLRoot(java.net.URL docSource, java.lang.String contentType) throws java.io.IOException
KMLRoot
for a URL
.docSource
- the URL identifying the document.contentType
- the content type of the data. Specify KMLConstants.KML_MIME_TYPE
for plain KML and
KMLConstants.KMZ_MIME_TYPE
for KMZ. Any other non-null value causes the content to be
treated as plain KML. If null is specified the content type is read from the server or other
end point of the URL. When a content type is specified, the content type returned by the URL's
end point is ignored. You can therefore force the content to be treated as KML or KMZ
regardless of what a server declares it to be.java.lang.IllegalArgumentException
- if the document source is null.java.io.IOException
- if an error occurs while reading the document.public KMLRoot(java.net.URL docSource, java.lang.String contentType, boolean namespaceAware) throws java.io.IOException
KMLRoot
for a URL
.docSource
- the URL identifying the document.contentType
- the content type of the data. Specify KMLConstants.KML_MIME_TYPE
for plain KML and
KMLConstants.KMZ_MIME_TYPE
for KMZ. Any other non-null value causes the content to
be treated as plain KML. If null is specified the content type is read from the server or
other end point of the URL. When a content type is specified, the content type returned by
the URL's end point is ignored. You can therefore force the content to be treated as KML or
KMZ regardless of what a server declares it to be.namespaceAware
- specifies whether to use a namespace-aware XML parser. true
if so,
false
if not.java.lang.IllegalArgumentException
- if the document source is null.java.io.IOException
- if an error occurs while reading the document.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the listener to call.java.lang.IllegalArgumentException
- if listener
is nullPropertyChangeSupport
protected boolean canParseContentType(java.lang.String mimeType)
mimeType
- Type to test. May be null.true
if mimeType
can be parsed as KML.protected void closeEventStream()
public static KMLRoot create(java.lang.Object docSource) throws java.io.IOException
File
, a URL
, a InputStream
, or a String
identifying either a file path or a URL. For all types other than
InputStream
an attempt is made to determine whether the source is KML or KMZ; KML is assumed if the
test is not definitive. Null is returned if the source type is not recognized.docSource
- either a File
, a URL
, or an InputStream
, or a String
identifying
a file path or URL.KMLRoot
for the specified source, or null if the source type is not supported.java.lang.IllegalArgumentException
- if the source is null.java.io.IOException
- if an error occurs while reading the source.public static KMLRoot create(java.lang.Object docSource, boolean namespaceAware) throws java.io.IOException
File
, a URL
, a InputStream
, or a String
identifying either a file path or a URL. For all types other than
InputStream
an attempt is made to determine whether the source is KML or KMZ; KML is assumed if the
test is not definitive. Null is returned if the source type is not recognized.docSource
- either a File
, a URL
, or an InputStream
, or a String
identifying a file path or URL.namespaceAware
- specifies whether to use a namespace-aware XML parser. true
if so,
false
if not.KMLRoot
for the specified source, or null if the source type is not supported.java.lang.IllegalArgumentException
- if the source is null.java.io.IOException
- if an error occurs while reading the source.public static KMLRoot createAndParse(java.lang.Object docSource) throws java.io.IOException, javax.xml.stream.XMLStreamException
File
, a URL
,
a InputStream
, or a String
identifying either a file path or a URL. For all types other than
InputStream
an attempt is made to determine whether the source is KML or KMZ; KML is assumed if the
test is not definitive. Null is returned if the source type is not recognized.
Note: Because there are so many incorrectly formed KML files in distribution, it's often not possible to parse with a namespace aware parser. This method first tries to use a namespace aware parser, but if a severe problem occurs during parsing, it will try again using a namespace unaware parser. Namespace unaware parsing typically bypasses many problems, but it also causes namespace qualified elements in the XML to be unrecognized.
docSource
- either a File
, a URL
, or an InputStream
, or a String
identifying
a file path or URL.KMLRoot
for the specified source, or null if the source type is not supported.java.lang.IllegalArgumentException
- if the source is null.java.io.IOException
- if an error occurs while reading the source.javax.xml.stream.XMLStreamException
- if the KML file has severe errors.protected KMLParserContext createParserContext(javax.xml.stream.XMLEventReader reader)
initialize(boolean)
to create the parser context. The parser context is created by the
global XMLEventParserContextFactory
.reader
- the reader to associate with the parser context.protected javax.xml.stream.XMLEventReader createReader(java.lang.Object docSource, boolean namespaceAware)
docSource
- the document source to create a reader for. The type can be any of those supported by
WWXML.openEventReader(Object)
.namespaceAware
- specifies whether to use a namespace-aware XML parser. true
if so,
false
if not.public void evictIfExpired(java.lang.String link, long expirationTime)
link
- Link that identifies the resource to check for expiration. This is the same link that was
passed to resolveReference to retrieve the resource.expirationTime
- Time at which the resource expires, in milliseconds since the Epoch. If the current system
time is greater than the expiration time, then the resource will be evicted.protected KMLAbstractFeature findFeature()
public void firePropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
propertyChangeEvent
- Event to fire.public void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
propertyName
- Name of the property change changed.oldValue
- The previous value of the property.newValue
- The new value of the property.protected java.beans.PropertyChangeSupport getChangeSupport()
public double getDetailHint()
setDetailHint(double)
.setDetailHint(double)
public long getExpiration(java.lang.String link)
resolveReference
or resolveNetworkLink
.link
- the address of the file (the same address as was previously passed to resolveReference). If null,
zero is returned.link
has
not been retrieved.public KMLAbstractFeature getFeature()
Feature
element contained in the document root.public java.lang.String getHint()
hint
attribute of the KML
element (the document root).public java.lang.Object getItemByID(java.lang.String id)
id
- the element's identifier. If null, null is returned.public KMLDoc getKMLDoc()
KMLRoot
.public KMLNetworkLinkControl getNetworkLinkControl()
KMLNetworkLinkControl
element if the document root contains it.protected XMLEventParserContext getParserContext()
public java.lang.String getSupportFilePath(java.lang.String link) throws java.io.IOException
java.io.IOException
protected void initialize(boolean namespaceAware) throws java.io.IOException
super.initialize(boolean)
.namespaceAware
- specifies whether to use a namespace-aware XML parser. true
if so,
false
if not.java.io.IOException
- if an I/O error occurs attempting to open the document source.public void onMessage(Message msg)
Overridden to forward the message to the root feature.
onMessage
in interface MessageListener
onMessage
in class KMLAbstractObject
msg
- The message that was received.public KMLRoot parse(java.lang.Object... args) throws javax.xml.stream.XMLStreamException
args
- optional arguments to pass to parsers of sub-elements.this
if parsing is successful, otherwise null.javax.xml.stream.XMLStreamException
- if an exception occurs while attempting to read the event stream.protected KMLRoot parseCachedKMLFile(java.net.URL url, java.lang.String linkBase, java.lang.String contentType, boolean namespaceAware) throws java.io.IOException, javax.xml.stream.XMLStreamException
url
- the URL of the file to open, expressed as a URL with a scheme of "file".linkBase
- the original address of the document if the file is a retrieved and cached file.contentType
- the mime type of the file's content, either a KML or KMZ mime type.namespaceAware
- specifies whether to use a namespace aware event reader.KMLRoot
representing the file's KML contents.java.io.IOException
- if an I/O error occurs during opening and parsing.javax.xml.stream.XMLStreamException
- if a server parsing error is encountered.public void preRender(KMLTraversalContext tc, DrawContext dc)
KMLRenderable
preRender
in interface KMLRenderable
tc
- the current KML traversal context.dc
- the current draw context.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the listener to remove.java.lang.IllegalArgumentException
- if listener
is null.PropertyChangeSupport
public void render(KMLTraversalContext tc, DrawContext dc)
KMLRenderable
render
in interface KMLRenderable
tc
- the current KML traversal context.dc
- the current draw context.public void requestRedraw()
public java.lang.Object resolveLocalReference(java.lang.String linkBase, java.lang.String linkRef)
linkBase
identifies a
document, including the current document, and linkRef
is the id of the desired element.
If linkBase
refers to a local KML or KMZ file and linkRef
is non-null, the return value is the
element identified by linkRef
. If linkRef
is null, the return value is a parsed KMLRoot
for the KML file identified by linkBase
.
If linkBase
refers a local file that is not a KML or KMZ file then linkBase
is returned. If
linkBase
cannot be resolved to a local file then null is returned.
linkBase
- the address of the document containing the requested element.linkRef
- the element's identifier.java.lang.IllegalArgumentException
- if the address is null.public java.lang.Object resolveNetworkLink(java.lang.String link, boolean cacheRemoteFile, long updateTime)
FileStore
.
The return value is a parsed KMLRoot representing the linked document. The return value is null if the linked file is not a KML file, or is not yet available in the FileStore.
The cacheRemoteFile
parameter specifies whether to store a retrieved remote file in the WorldWind
cache or in a temporary location. This parameter has no effect if the file exists locally. The temporary location
for a retrieved file does not persist between runtime sessions, and subsequent invocations of this method may not
return the same temporary location.
link
- the address to resolvecacheRemoteFile
- true
to store remote files in the WorldWind cache, or false
to
store remote files in a temporary location. Has no effect if the address is a local file.updateTime
- the time at which the link was last updated. If a cached file exists for the specified
resource, the file must have been retrieved after the link update time. Otherwise, the
cache entry is considered invalid, and the file is deleted and retrieved again.java.lang.IllegalArgumentException
- if the link
is null.public java.lang.Object resolveReference(java.lang.String link)
If the address part identifies the current document, the document is searched for the specified identifier.
Otherwise the document is retrieved, opened and searched for the identifier. If the address refers to a remote
document and the document has not previously been retrieved and cached locally, retrieval is initiated and this
method returns null
. Once the document is successfully retrieved, subsequent calls to this method
return the identified element, if it exists.
If the link does not contain an identifier part, this initiates a retrieval for document referenced by the
address part and returns null
. Once the document is retrieved this opens the the document as a
KMLRoot
. Subsequent calls to this method return the opened document, if it exists.
link
- the document address in the form address#identifier.null
if the document
or the element are not found.java.lang.IllegalArgumentException
- if the link
is null
.public java.lang.Object resolveReference(java.lang.String link, boolean cacheRemoteFile)
If the address part identifies the current document, the document is searched for the specified identifier.
Otherwise the document is retrieved, opened and searched for the identifier. If the address refers to a remote
document and the document has not previously been retrieved and cached locally, retrieval is initiated and this
method returns null
. Once the document is successfully retrieved, subsequent calls to this method
return the identified element, if it exists.
If the link does not contain an identifier part, this initiates a retrieval for document referenced by the
address part and returns null
. Once the document is retrieved this opens the the document as a
KMLRoot
. Subsequent calls to this method return the opened document, if it exists.
The cacheRemoteFile
parameter specifies whether to store a retrieved remote document in the World
Wind cache or in a temporary location. This parameter has no effect if the document exists locally. The temporary
location for a retrieved document does not persist between runtime sessions, and subsequent invocations of this
method may not return the same temporary location.
link
- the document address in the form address#identifier.cacheRemoteFile
- true
to store remote documents in the WorldWind cache, or false
to store remote documents in a temporary location. Has no effect if the address is a local
document.null
if the document
or the element are not found.java.lang.IllegalArgumentException
- if the link
is null
.public java.lang.Object resolveRemoteReference(java.lang.String linkBase, java.lang.String linkRef)
linkBase
identifies
a remote document, and linkRef
is the id of the desired element. This method retrieves resources
asynchronously using the FileStore
.
The return value is null if the file is not yet available in the FileStore. If linkBase
refers to a KML
or KMZ file and linkRef
is non-null, the return value is the element identified by linkRef
. If
linkBase
refers to a KML or KMZ and linkRef
is null, the return value is a parsed KMLRoot
for the KML file identified by linkBase
. Otherwise the return value is a URL
to the file in the
file cache.
linkBase
- the address of the document containing the requested element.linkRef
- the element's identifier.java.lang.IllegalArgumentException
- if the linkBase
is null.public java.lang.Object resolveRemoteReference(java.lang.String linkBase, java.lang.String linkRef, boolean cacheRemoteFile)
linkBase
identifies
a remote document, and linkRef
is the id of the desired element. This method retrieves resources
asynchronously using the FileStore
.
The return value is null if the file is not yet available in the FileStore. If linkBase
refers to a KML
or KMZ file and linkRef
is non-null, the return value is the element identified by linkRef
. If
linkBase
refers to a KML or KMZ and linkRef
is null, the return value is a parsed KMLRoot
for the KML file identified by linkBase
. Otherwise the return value is a URL
to the file in the
file cache or a temporary location, depending on the value of cacheRemoteFile
.
The cacheRemoteFile
parameter specifies whether to store a retrieved remote file in the WorldWind
cache or in a temporary location. This parameter has no effect if the file exists locally. The temporary location
for a retrieved file does not persist between runtime sessions, and subsequent invocations of this method may not
return the same temporary location.
linkBase
- the address of the document containing the requested element.linkRef
- the element's identifier.cacheRemoteFile
- true
to store remote files in the WorldWind cache, or false
to
store remote files in a temporary location. Has no effect if the address is a local file.java.lang.IllegalArgumentException
- if the linkBase
is null.public void setDetailHint(double detailHint)
The top level KML root's detail hint is inherited by all KML elements beneath that root, including any descendant KML roots loaded by network links. If this KML root has been loaded by a network link, its detail hint is ignored.
detailHint
- the degree to modify the default relationship of KML scene resolution to screen resolution as
viewing distance changes. Values greater than 0 increase the resolution. Values less than 0
decrease the resolution. The default value is 0.public void setNotificationListener(XMLParserNotificationListener listener)
The default notification listener writes a message to the log, and otherwise does nothing.
listener
- the listener to receive notifications. Specify null to indicate no listener.XMLParserNotification