Hi,
I'm new to ArcGIS runtime sdk for java.
I need my app to open my own base map that represented by about 6-7 .ecw files (including of course matching .aux files).
How do I add a layer from .ecw file to JMap?
I tried:
JMap map = new JMap(); ... String rasterPath = "k5521.ecw"; //the file is in the folder of the project
FileRasterSource rasterSource;
try {
rasterSource = new FileRasterSource(rasterPath);
RasterLayer rasterLayer = new RasterLayer(rasterSource);
map.getLayers().add(rasterLayer);
} catch (IllegalArgumentException iex) {
// handle exception
} catch (FileNotFoundException fe) {
// handle exception
} catch (RuntimeException re) { // handle exception }
and also:
FileRasterSource rasterSource = new FileRasterSource("k5521.ecw");
rasterSource.project(map.getSpatialReference());
RasterLayer rasterLayer = new RasterLayer(rasterSource);
map.getLayers().add(rasterLayer);
what am I doing wrong?