Search code examples
java.netarcgisarcgis-runtime

Is there any way we can get all the features of an ENC layer and toggle their visibility in java or .net ArcGIS SDKs?


I was looking for an way to get the list of all the features, from an ENC layer, while looking through coding samples I came across this.

In this sample code we have MapView.IdentifyLayersAsync and MapView.IdentifyLayerAsync methods, both these methods return Task> and Task respectively and we can then get features from the GeoElements, but both these methods require Point as input parameters, How can we do this without providing the point i.e. get all the features of a ENC layer and is it possible to toggle their visibility in MapView (specially in java 100.7.0)? Thanks in Advance


Solution

  • I have been using the same version of the Java runtime SDK v100.7.0 and came across the same issue. After going through their documentation at Display electronic navigational charts - ArcGIS Runtime SDK for Java under "Set ENC environment settings", it's mentioned:

    ENC layers are displayed in accordance with the IHO S-52 standard. You can define the display properties of your ENC layers by using the static EncEnvironmentSettings class. These settings apply to all ENC layers in all maps. Settings fall under three categories: mariner settings, text group visibility settings, and viewing group settings. Text group settings control the display of labels for features, mariner settings control the symbolization and presentation of ENC features, and viewing group settings allow for quickly applying settings to logical groups of feature types. Example:

        // Enables display of seabed information for all ENC layers
    EncEnvironmentSettings.getDisplaySettings().getTextGroupVisibilitySettings().setIsNatureOfSeabed(true);
    

    So to alter the visibility for each of the feature type, you can call the specific category from EncEnvironmentSettings.getDisplaySettings() and then set the visibility for a specific feature under that category using a boolean value.

    This ArcGIS class documentation would help EncEnvironmentSettings.DisplaySettings Class