public void setTileSource(TileSource tileSource) { if (tileSource.getMaxZoom() > MAX_ZOOM) throw new RuntimeException("Maximum zoom level too high"); if (tileSource.getMinZoom() < MIN_ZOOM) throw new RuntimeException("Minumim zoom level too low"); tileController.setTileSource(tileSource); zoomSlider.setMinimum(tileSource.getMinZoom()); zoomSlider.setMaximum(tileSource.getMaxZoom()); tileController.cancelOutstandingJobs(); if (zoom > tileSource.getMaxZoom()) setZoom(tileSource.getMaxZoom()); repaint(); }
public void setZoom(int zoom) { setZoom(zoom, new Point(getWidth() / 2, getHeight() / 2)); }
/** Decreases the current zoom level by one */ public void zoomOut(Point mapPoint) { setZoom(zoom - 1, mapPoint); }
/** Decreases the current zoom level by one */ public void zoomOut() { setZoom(zoom - 1); }
/** Increases the current zoom level by one */ public void zoomIn(Point mapPoint) { setZoom(zoom + 1, mapPoint); }
/** Increases the current zoom level by one */ public void zoomIn() { setZoom(zoom + 1); }