Class EncLayer

  • All Implemented Interfaces:
    LayerContent, Loadable

    public final class EncLayer
    extends Layer
    An ENC (Electronic Navigational Chart) Layer is used to render data from an EncCell. All ENC layers will render based on EncEnvironmentSettings.DisplaySettings.

    Example for working with a ENC Layer:

     
     EncCell encCell = new EncCell("file-path-of-ENC-cell");
     
     EncLayer encLayer = new EncLayer(encCell);
     
     encLayer.addDoneLoadingListener(new Runnable() {
       public void run() {
         if (encLayer.getLoadStatus() == LoadStatus.LOADED) {
           // ENC layer has loaded
         }
       }
     });
     
     map.getOperationalLayers().add(encLayer);
     
     mapView.setMap(map);
     
    The layer is loaded when displayed in a MapView; if using the layer without a MapView, call the Layer.loadAsync() method. Use the layer done loading event to determine when the layer is ready, and check the load status before using the layer.
    Since:
    100.2.0
    See Also:
    EncEnvironmentSettings
    • Constructor Detail

      • EncLayer

        public EncLayer​(EncCell encCell)
        Creates an EncLayer based on an EncCell.
        Parameters:
        encCell - an ENC cell
        Throws:
        IllegalArgumentException - if encCell is null
        Since:
        100.2.0
    • Method Detail

      • getCell

        public EncCell getCell()
        Gets the ENC cell this layer was initialized with.
        Returns:
        the ENC cell this layer was initialized with
        Since:
        100.2.0
      • selectFeature

        public void selectFeature​(EncFeature encFeature)
        Selects an ENC feature.

        Only a single ENC feature can be selected at a time. Selecting a feature using this method will unselect any previously selected feature.

        An ENC feature can be rendered as multiple objects. Each object that makes up this feature will be selected.

        Parameters:
        encFeature - ENC feature to select
        Throws:
        IllegalArgumentException - if encFeature is null
        Since:
        100.2.0
      • clearSelection

        public void clearSelection()
        Clears / Unselects a previously selected ENC feature, if any.
        Since:
        100.2.0