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