ArcGIS SDK for Java- using .ecw file as basemap

2871
0
02-26-2015 09:29 AM
idozoar
New Contributor

Hi,
I'm new to ArcGIS SDK for Java and I'm basically trying to develop an app which use my own basemap (packed in .ecw format).

What is missing is the code to create the layers of the the files i'm using.
the code is:

import ...
...
public class NewMapUI {

  private JFrame window;
  private JMap map;

  public NewMapUI() {
    window = new JFrame();
    window.setSize(800, 600);
    window.setLocationRelativeTo(null); // center on screen
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.getContentPane().setLayout(new BorderLayout(0, 0));

    window.addWindowListener(new WindowAdapter() {
      @Override
      public void windowClosing(WindowEvent windowEvent) {
        super.windowClosing(windowEvent);
        map.dispose();
      }
    });


     myLayers... //here is where my .ecw file needs to be rendered.


    map = new JMap(myLayers);
    window.getContentPane().add(map);


  }


  /**
   * Starting point of this application.
   * @param args
   */
  public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {


      @Override
      public void run() {
        try {
          NewMapUI application = new NewMapUI();
          application.window.setVisible(true);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    });
  }
}
Tags (3)
0 Kudos
0 Replies