Beispiel #1
0
 public void setZoom(int zoom, Point mapPoint) {
   if (zoom > tileController.getTileSource().getMaxZoom()
       || zoom < tileController.getTileSource().getMinZoom()
       || zoom == this.zoom) return;
   Coordinate zoomPos = getPosition(mapPoint);
   tileController.cancelOutstandingJobs(); // Clearing outstanding load
   // requests
   setDisplayPositionByLatLon(mapPoint, zoomPos.getLat(), zoomPos.getLon(), zoom);
 }
Beispiel #2
0
 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();
 }