Example #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);
    }
  }
Example #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);
 }
Example #3
0
 public void destroy() {
   map.close();
   renderWorker.shutdown();
 }