return; // not available?
}
graphLayer = (ILayer) added.get(0);
}
if( !graphLayer.isVisible() ){
map.sendCommandASync( new SetLayerVisibilityCommand(graphLayer, true) );
}
for( ILayer look : map.getMapLayers() ){
URL id = look.getGeoResource().getIdentifier();
if(PATH_ID.equals(id) ){
pathLayer = look;
break;
}
}
if( pathLayer == null ){
ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
IGeoResource resource = catalog.getById(IGeoResource.class, PATH_ID, new NullProgressMonitor() );
if( resource == null ){
return; // not available?
}
List<IGeoResource> resourceList = Collections.singletonList( resource );
List< ? extends ILayer> added = ApplicationGIS.addLayersToMap(map, resourceList, 0 );
if( added.isEmpty() ){
return; // not available?
}
pathLayer = (ILayer) added.get(0);
}
if( !pathLayer.isVisible() ){
map.sendCommandASync( new SetLayerVisibilityCommand(pathLayer, true) );
}
pathLayer.refresh(null);
}