Class KmlNetworkLink

java.lang.Object
com.esri.arcgisruntime.ogc.kml.KmlNode
com.esri.arcgisruntime.ogc.kml.KmlNetworkLink

public final class KmlNetworkLink extends KmlNode
A KML network link references other KML resources, locally or on the network.

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
  • Constructor Details

    • KmlNetworkLink

      public KmlNetworkLink(String uri)
      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

      public KmlContainer.ListItemType 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

      public void setListItemType(KmlContainer.ListItemType listItemType)
      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

      public List<KmlNode> 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

      public String getUri()
      Gets the KML network link URI.
      Returns:
      the KML network link URI
      Since:
      100.4.0
      See Also:
    • setUri

      public void setUri(String uri)
      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 is KmlRefreshMode.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

      public void setRefreshMode(KmlRefreshMode refreshMode)
      Sets the KML network link refresh mode.
      Parameters:
      refreshMode - a KmlRefreshMode
      Throws:
      IllegalArgumentException - if refreshMode is null
      Since:
      100.6.0
    • getRefreshMode

      public KmlRefreshMode 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

      public void setViewRefreshMode(KmlViewRefreshMode viewRefreshMode)
      Sets the KML network link view refresh mode.
      Parameters:
      viewRefreshMode - a KmlViewRefreshMode
      Throws:
      IllegalArgumentException - if viewRefreshMode is null
      Since:
      100.6.0
    • getViewRefreshMode

      public KmlViewRefreshMode 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