A KML network link can have a refresh interval defined to enable regular refresh of data. Alternatively, KML network links support a view refresh mode, which fetches network links based on the visible extent.
- Since:
- 100.4.0
-
Property Summary
Properties inherited from class com.esri.arcgisruntime.ogc.kml.KmlNode
balloonBackgroundColor, uxIconColor
-
Nested Class Summary
Nested classes/interfaces inherited from class com.esri.arcgisruntime.ogc.kml.KmlNode
KmlNode.RefreshStatus
-
Constructor Summary
ConstructorDescriptionKmlNetworkLink
(String uri) Constructs a KML network link for the given URI which references a KML/KMZ file on a local or remote network. -
Method Summary
Modifier and TypeMethodDescriptionboolean
True if the app should zoom to the KML network link when it refreshes, false otherwise.Gets the KML network link's child nodes.Get the network link's list item type, which defines how child nodes behave when setting visibility.long
Gets the KML network link refresh interval.Gets the KML network link refresh mode.getUri()
Gets the KML network link URI.Gets the KML network link view refresh mode.long
Gets the KML network link view refresh time.boolean
True if the visibility selection is preserved for nodes in a network link after refresh, false otherwise.boolean
isOpen()
True if the KML network link is open, false otherwise.boolean
True if the KML network link is partially visible, false otherwise.void
refresh()
Refreshes the KML network link.void
setCanFlyToNode
(boolean canFlyToNode) True if the app should zoom to the KML network link when it refreshes, false otherwise.void
setListItemType
(KmlContainer.ListItemType listItemType) Sets the network link's list item type.void
setOpen
(boolean open) True if the KML network link is open, false otherwise.void
setRefreshInterval
(long refreshInterval) Sets the KML network link refresh interval.void
setRefreshMode
(KmlRefreshMode refreshMode) Sets the KML network link refresh mode.void
setRefreshVisibility
(boolean refreshVisibility) True if the visibility selection is preserved for nodes in a network link after refresh, false otherwise.void
Sets the KML network link URI.void
setViewRefreshMode
(KmlViewRefreshMode viewRefreshMode) Sets the KML network link view refresh mode.void
setViewRefreshTime
(long viewRefreshTime) Sets the KML network link view refresh time.Methods inherited from class com.esri.arcgisruntime.ogc.kml.KmlNode
addIconUpdatedEventListener, addRefreshStatusChangedListener, balloonBackgroundColorProperty, getAddress, getBalloonBackgroundColor, getBalloonContent, getDescription, getExtent, getHighlightStyle, getId, getName, getParentNode, getRefreshError, getRefreshStatus, getSnippet, getSnippetMaxLines, getStyle, getTimeExtent, getUxIcon, getUxIconColor, getUxIconId, getViewpoint, isHighlighted, isVisible, removeIconUpdatedEventListener, removeRefreshStatusChangedListener, saveAsAsync, setAddress, setDescription, setHighlighted, setHighlightStyle, setId, setName, setSnippet, setSnippetMaxLines, setStyle, setTimeExtent, setViewpoint, setVisible, uxIconColorProperty
-
Constructor Details
-
KmlNetworkLink
Constructs a KML network link for the given URI which references a KML/KMZ file on a local or remote network.- Parameters:
uri
- a URI pointing to a local or remote KML source- Throws:
IllegalArgumentException
- if uri is null or empty- Since:
- 100.6.0
-
-
Method Details
-
getListItemType
Get the network link's list item type, which defines how child nodes behave when setting visibility.- Returns:
- the network link's list item type
- Since:
- 100.4.0
-
setListItemType
Sets the network link's list item type.This defines how visibility selection should work, enabling either single or multiple selection of child nodes when shown in a list (for example, a legend). When the item type is
KmlContainer.ListItemType.RADIO_FOLDER
, making a node visible will hide its sibling nodes. See the OGC specification for more details.- Parameters:
listItemType
- a ListItemType- Throws:
IllegalArgumentException
- if listItemType is null- Since:
- 100.6.0
-
getChildNodes
Gets the KML network link's child nodes. If this network link node is refreshed the list will be invalidated and this method should be called again to get the new list.- Returns:
- an unmodifiable list of child nodes
- Since:
- 100.4.0
-
isOpen
public boolean isOpen()True if the KML network link is open, false otherwise.- Returns:
- true if the KML network link is open, false otherwise
- Since:
- 100.4.0
-
setOpen
public void setOpen(boolean open) True if the KML network link is open, false otherwise.- Parameters:
open
- true if the KML network link is open, false otherwise- Since:
- 100.4.0
-
isPartiallyVisible
public boolean isPartiallyVisible()True if the KML network link is partially visible, false otherwise.- Returns:
- true if the KML network link is partially visible, false otherwise
- Since:
- 100.4.0
-
canFlyToNode
public boolean canFlyToNode()True if the app should zoom to the KML network link when it refreshes, false otherwise.The property is defined in the flyToView tag in the KML network link.
- Returns:
- true if the app should zoom to the KML network link when it refreshes, false otherwise
- Since:
- 100.4.0
-
setCanFlyToNode
public void setCanFlyToNode(boolean canFlyToNode) True if the app should zoom to the KML network link when it refreshes, false otherwise.When this is defined, the app should zoom to the viewpoint defined on the associated NetworkLinkControl or the network links' top-level KML node upon refresh of the link. The app will not automatically fly to the node on refresh. It is the application developer's responsibility to implement this behavior, if desired.
You can listen for the refresh status changed event to detect when the geoview's viewpoint should be updated.
This is defined in the flyToView tag in the network link.
- Parameters:
canFlyToNode
- true if the app should zoom to the KML network link when it refreshes, false otherwise- Since:
- 100.6.0
-
hasRefreshVisibility
public boolean hasRefreshVisibility()True if the visibility selection is preserved for nodes in a network link after refresh, false otherwise.If true, it will attempt to maintain any visibility selection for the network link's child nodes after refresh. This is the default behavior when
refreshVisibility
is set to 0 or unset in the source KML file.- Returns:
- true if the visibility selection is preserved for nodes in a network link after refresh, false otherwise
- Since:
- 100.4.0
-
setRefreshVisibility
public void setRefreshVisibility(boolean refreshVisibility) True if the visibility selection is preserved for nodes in a network link after refresh, false otherwise.This corresponds to the 'refreshVisibility' property in the source KML file.
- Parameters:
refreshVisibility
- true if the visibility selection is preserved for nodes in a network link after refresh, false otherwise- Since:
- 100.6.0
-
getUri
Gets the KML network link URI.- Returns:
- the KML network link URI
- Since:
- 100.4.0
- See Also:
-
setUri
Sets the KML network link URI.After setting a new URI, you should call
refresh()
to fetch the data from the new URI. If the refresh mode of the network link isKmlRefreshMode.ON_INTERVAL
when the URI is changed, the refresh operation executed on the following interval will use the new URI value.- Parameters:
uri
- the KML network link URI- Throws:
IllegalArgumentException
- if uri is null or empty- Since:
- 100.6.0
- See Also:
-
refresh
public void refresh()Refreshes the KML network link.- Since:
- 100.6.0
-
setRefreshMode
Sets the KML network link refresh mode.- Parameters:
refreshMode
- a KmlRefreshMode- Throws:
IllegalArgumentException
- if refreshMode is null- Since:
- 100.6.0
-
getRefreshMode
Gets the KML network link refresh mode.- Returns:
- a KmlRefreshMode
- Since:
- 100.6.0
-
setRefreshInterval
public void setRefreshInterval(long refreshInterval) Sets the KML network link refresh interval.- Parameters:
refreshInterval
- refresh interval in milliseconds- Throws:
IllegalArgumentException
- if refreshInterval is negative- Since:
- 100.6.0
-
getRefreshInterval
public long getRefreshInterval()Gets the KML network link refresh interval.- Returns:
- refresh interval in milliseconds
- Since:
- 100.6.0
-
setViewRefreshMode
Sets the KML network link view refresh mode.- Parameters:
viewRefreshMode
- a KmlViewRefreshMode- Throws:
IllegalArgumentException
- if viewRefreshMode is null- Since:
- 100.6.0
-
getViewRefreshMode
Gets the KML network link view refresh mode.- Returns:
- a KmlViewRefreshMode
- Since:
- 100.6.0
-
setViewRefreshTime
public void setViewRefreshTime(long viewRefreshTime) Sets the KML network link view refresh time.- Parameters:
viewRefreshTime
- view refresh time in milliseconds- Throws:
IllegalArgumentException
- if viewRefreshTime is negative- Since:
- 100.6.0
-
getViewRefreshTime
public long getViewRefreshTime()Gets the KML network link view refresh time.- Returns:
- the KML network link view refresh time in milliseconds
- Since:
- 100.6.0
-