MapView bug: unable to pan vertically between multiple loaded ENCs

887
3
Jump to solution
08-20-2018 07:01 PM
TiakiRice
New Contributor

I am creating an ArcGIS map from a collection of EncLayers containing charts that cover the world. While the map loads all the charts correctly inside a MapView, I am unable to move the Viewpoint outside the vertical bounds of the first layer loaded.


How should I load the charts into a map so that I can freely pan the map across all of them?

I am loading S-57 charts (I've tried loading them both using a catalog and individually) and ArcGIS Runtime 100.3.0.


I am loading the charts as follows:

map = new ArcGISMap(new Basemap(EncLayerManager.getLayers(), null));‍‍

‍‍where EncLayerManager.getLayers() returns a List of EncLayers that is created in the function below.

public static void loadLayers(Iterable<String> paths) {

  EncExchangeSet encExchangeSet = new EncExchangeSet(paths);

  encExchangeSet.addDoneLoadingListener(() -> {
    synchronized (layers){
    //loop through the datasets and add to the map
      for (EncDataset encDataset : encExchangeSet.getDatasets()) {
        EncCell encCell = new EncCell(encDataset);
        EncLayer encLayer = new EncLayer(encCell);
        layers.addLast(encLayer);
      }
      System.out.println("Loaded " + layers.size() + " ENC Charts");
    }
  });

  encExchangeSet.loadAsync();
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

The MapView is being created using FXML and has its map set with:

map.setView(map);‍‍

For example, if the chart contained in the first layer in the list covers latitudes from 60N to 85N I am unable to pan the view so its centre is below 60N, even though there are other charts loaded that cover this area.

However, when I first load a web-based base map before adding the EncLayers, the problem does not present itself and I can pan freely. This, unfortunately, doesn't solve my problem as the application is required to work without an internet connection. In this case, I load the charts like so:

map = new ArcGISMap(Basemap.createOceans());
map.getBasemap().getBaseLayers().addAll(EncLayerManager.getLayers());‍‍‍‍

I have tried using a tiled layer loaded from a file to create the basemap and while this did allow me to scroll between charts, it also caused significant rendering errors while displaying those charts, as shown below:

 

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
MarkBaird
Esri Regular Contributor

Byron Conroy

Okay I followed your workflow with the NOAA test datasets.  If I init my ArcGISMap class with a standard basemap it works fine as you point out.  Changing to not using a basemap reproduces the panning issue you see.

Having looked at this, the extent of the map is limited to the area of the first ENC cell you are loading.  If however you init the ArcGISMap class specifying a spatial reference you will be able to pan anywhere.  I used the following code to set up my map:

// init the map with a spatial reference
map = new ArcGISMap(SpatialReferences.getWebMercator());

Does this fix your issue?

Mark

View solution in original post

3 Replies
MarkBaird
Esri Regular Contributor

Hi,

Apologies for the delay in responding.  I'm currently in the process of trying to reproduce this with the sample NOAA data from http://www.charts.noaa.gov/ENCs/ENCs.shtml 

I'll let you know what I find.

Mark

0 Kudos
MarkBaird
Esri Regular Contributor

Byron Conroy

Okay I followed your workflow with the NOAA test datasets.  If I init my ArcGISMap class with a standard basemap it works fine as you point out.  Changing to not using a basemap reproduces the panning issue you see.

Having looked at this, the extent of the map is limited to the area of the first ENC cell you are loading.  If however you init the ArcGISMap class specifying a spatial reference you will be able to pan anywhere.  I used the following code to set up my map:

// init the map with a spatial reference
map = new ArcGISMap(SpatialReferences.getWebMercator());

Does this fix your issue?

Mark

TiakiRice
New Contributor

This has resolved the issue. Everything now works as intended. Thanks Mark.

0 Kudos