예제 #1
0
  public void addLayers(List<Dataset> datasets) {
    if (datasets.isEmpty()) {
      return;
    }

    try {
      if (map.getLayers().isEmpty()) {
        Dataset first = datasets.iterator().next();

        map.setBounds(first.bounds());
        map.setCRS(first.getCRS());
      }

      for (Dataset data : datasets) {
        map.getLayers().add(new Layer(data));
      }

      redraw();
    } catch (IOException e) {
      throw new AndroidRuntimeException(e);
    }
  }
예제 #2
0
 @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
   image = Bitmap.createBitmap(w, h, Bitmap.Config.ALPHA_8);
   viewport.resize(w, h);
   map.setSize(w, h);
 }
예제 #3
0
 public void destroy() {
   map.close();
   renderWorker.shutdown();
 }