Package org.geomajas.command.dto

Examples of org.geomajas.command.dto.GetRasterTilesRequest


  // @todo need to add a dummy raster layer in the context to do a normal test run

  @Test
  public void testNoLayerIdRequest() throws Exception {
    GetRasterTilesRequest request = new GetRasterTilesRequest();
    request.setCrs(CRS);
    GetRasterTilesResponse response = (GetRasterTilesResponse) dispatcher.execute(
        GetRasterTilesRequest.COMMAND, request, null, "en");
    Assert.assertTrue(response.isError());
    Assert.assertTrue(response.getErrors().get(0) instanceof GeomajasException);
    Assert.assertEquals(ExceptionCode.PARAMETER_MISSING,
View Full Code Here


  }

  private void fetchAndUpdateTiles(Bbox bounds, final TileFunction<RasterTile> onUpdate) {
    // fetch a bigger area to avoid server requests while panning
    tileBounds = bounds.scale(3);
    GetRasterTilesRequest request = new GetRasterTilesRequest();
    request.setBbox(new org.geomajas.geometry.Bbox(tileBounds.getX(), tileBounds.getY(), tileBounds.getWidth(),
        tileBounds.getHeight()));
    request.setCrs(getLayer().getMapModel().getCrs());
    request.setLayerId(getLayer().getServerLayerId());
    request.setScale(getLayer().getMapModel().getMapView().getCurrentScale());
    GwtCommand command = new GwtCommand(GetRasterTilesRequest.COMMAND);
    command.setCommandRequest(request);
    RasterCallBack callBack = new RasterCallBack(worldToPan(bounds), onUpdate);
    deferred = GwtCommandDispatcher.getInstance().execute(command, callBack);
  }
View Full Code Here

    // Scale the bounds to fetch tiles for:
    currentTileBounds = bounds.scale(mapExentScaleAtFetch);

    // Create the command:
    GetRasterTilesRequest request = new GetRasterTilesRequest();
    request.setBbox(new org.geomajas.geometry.Bbox(currentTileBounds.getX(), currentTileBounds.getY(),
        currentTileBounds.getWidth(), currentTileBounds.getHeight()));
    request.setCrs(viewPort.getCrs());
    request.setLayerId(rasterLayer.getServerLayerId());
    request.setScale(viewPort.getScale());
    Command command = new Command(GetRasterTilesRequest.COMMAND);
    command.setCommandRequest(request);

    // Execute the fetch, and render on success:
    deferred = commandService.execute(command, new CommandCallback() {
View Full Code Here

  private void fetchTiles(final Bbox bounds) {
    // Scale the bounds to fetch tiles for:
    currentTileBounds = bounds.scale(mapExentScaleAtFetch);

    // Create the command:
    GetRasterTilesRequest request = new GetRasterTilesRequest();
    request.setBbox(new org.geomajas.geometry.Bbox(currentTileBounds.getX(), currentTileBounds.getY(),
        currentTileBounds.getWidth(), currentTileBounds.getHeight()));
    request.setCrs(viewPort.getCrs());
    request.setLayerId(rasterLayer.getServerLayerId());
    request.setScale(viewPort.getScale());
    Command command = new Command(GetRasterTilesRequest.COMMAND);
    command.setCommandRequest(request);

    // Execute the fetch, and render on success:
    deferred = commandService.execute(command, new CommandCallback() {
View Full Code Here

TOP

Related Classes of org.geomajas.command.dto.GetRasterTilesRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.