Examples of GetVectorTileRequest


Examples of org.geomajas.command.dto.GetVectorTileRequest

  @Autowired
  private CommandDispatcher dispatcher;

  @Test
  public void testGetVectorTile() throws Exception {
    GetVectorTileRequest request = new GetVectorTileRequest();
    request.setCrs(CRS);
    request.setLayerId(LAYER_ID);
    request.setCode(new TileCode(0, 0, 0));
    request.setPanOrigin(new Coordinate(0, 0));
    request.setRenderer(GetVectorTileRequest.PARAM_SVG_RENDERER);
    request.setScale(1.0);
    GetVectorTileResponse response = (GetVectorTileResponse) dispatcher.execute(
        GetVectorTileRequest.COMMAND, request, null, "en");
    if (response.isError()) {
      response.getErrors().get(0).printStackTrace();
    }
View Full Code Here

Examples of org.geomajas.command.dto.GetVectorTileRequest

  @Test
  public void testRasterizeFromCache() throws Exception {
    InternalTile tile;
    // create metadata
    GetVectorTileRequest metadata = new GetVectorTileRequest();
    metadata.setCode(new TileCode(4, 8, 8));
    metadata.setCrs("EPSG:4326");
    metadata.setLayerId(layerBeans.getId());
    metadata.setPanOrigin(new Coordinate(0, 0));
    metadata.setScale(16);
    metadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    metadata.setStyleInfo(layerBeansStyleInfo);
    metadata.setPaintLabels(false);
    metadata.setPaintGeometries(true);
    // get tile
    recorder.clear();
    tile = vectorLayerService.getTile(metadata);
    Assert.assertEquals("", recorder.matches(CacheCategory.RASTER));
    // find the key
View Full Code Here

Examples of org.geomajas.command.dto.GetVectorTileRequest

  @Test
  public void testRasterizeFromRebuildCache() throws Exception {
    InternalTile tile;
    // create metadata
    GetVectorTileRequest metadata = new GetVectorTileRequest();
    metadata.setCode(new TileCode(4, 8, 8));
    metadata.setCrs("EPSG:4326");
    metadata.setLayerId(layerBeansPoint.getId());
    metadata.setPanOrigin(new Coordinate(1, 1));
    metadata.setScale(16);
    metadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    metadata.setStyleInfo(layerBeansPointStyleInfo);
    metadata.setPaintLabels(false);
    metadata.setPaintGeometries(true);
    // get tile
    recorder.clear();
    tile = vectorLayerService.getTile(metadata);
    // find the key
    String url = tile.getFeatureContent();
View Full Code Here

Examples of org.geomajas.command.dto.GetVectorTileRequest

  }

  @Test
  public void testGetVectorTileRasterized() throws Exception {
    InternalTile tile;
    GetVectorTileRequest metadata;
    String url;
    // get tile
    metadata = createRequest();
    recorder.clear();
    tile = vectorLayerService.getTile(metadata);
View Full Code Here

Examples of org.geomajas.command.dto.GetVectorTileRequest

    }
    return url;
  }

  private GetVectorTileRequest createRequest() {
    GetVectorTileRequest metadata = new GetVectorTileRequest();
    metadata.setCode(new TileCode(4, 8, 8));
    metadata.setCrs("EPSG:4326");
    metadata.setLayerId(layerBeansMultiLine.getId());
    metadata.setPanOrigin(new Coordinate(12, 10));
    metadata.setScale(16);
    metadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    metadata.setStyleInfo(layerBeansMultiLineStyleInfo);
    metadata.setPaintLabels(false);
    metadata.setPaintGeometries(true);
    return metadata;
  }
View Full Code Here

Examples of org.geomajas.command.dto.GetVectorTileRequest

  }

  @Test
  public void testGetTile() throws Exception {
    InternalTile tile;
    TileMetadata tmd = new GetVectorTileRequest();
    tmd.setCrs("EPSG:4326");
    tmd.setCode(new TileCode(1,0,0));
    tmd.setLayerId(LAYER_BEANS);
    tmd.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    tmd.setScale(1.0);
    tmd.setPanOrigin(new Coordinate(0, 0));

    // first run, this should put things in the cache
    recorder.clear();
    tmd.setCode(new TileCode(1,0,0));
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
    Assert.assertEquals("<g id=\"beans.features.1-0-0\"><g style=\"fill:#995500;fill-opacity:0.6;stroke:#995500;stroke-opacity:0.3;stroke-width:1px;\" id=\"beans.features.1-0-0.0\"><path fill-rule=\"evenodd\" d=\"M0 0l1 0 0 -1 -1 0 0 1 Z\" id=\"1\"/></g></g>", tile.getFeatureContent());
    Assert.assertEquals("", recorder.matches(CacheCategory.FEATURE, "Put item in cache"));
    Assert.assertEquals("", recorder.matches(CacheCategory.TILE, "Put item in cache"));

    // first run, this should put things in the cache
    recorder.clear();
    tmd.setCode(new TileCode(1,1,0));
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
    Assert.assertEquals("<g id=\"beans.features.1-1-0\"><g style=\"fill:#995500;fill-opacity:0.6;stroke:#995500;stroke-opacity:0.3;stroke-width:1px;\" id=\"beans.features.1-1-0.0\"><path fill-rule=\"evenodd\" d=\"M4 0l2 0 0 -3 -2 0 0 3 Z\" id=\"2\"/></g></g>", tile.getFeatureContent());
    Assert.assertEquals("", recorder.matches(CacheCategory.FEATURE, "Put item in cache"));
    Assert.assertEquals("", recorder.matches(CacheCategory.TILE, "Put item in cache"));

    // first run, this should put things in the cache
    recorder.clear();
    tmd.setCode(new TileCode(1,1,1));
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
    Assert.assertEquals("<g id=\"beans.features.1-1-1\"><g style=\"fill:#995500;fill-opacity:0.6;stroke:#995500;stroke-opacity:0.3;stroke-width:1px;\" id=\"beans.features.1-1-1.0\"><path fill-rule=\"evenodd\" d=\"M2 -1l4 0 1 -1 -5 0 0 1 Z\" id=\"3\"/></g></g>", tile.getFeatureContent());
    Assert.assertEquals("", recorder.matches(CacheCategory.FEATURE, "Put item in cache"));
    Assert.assertEquals("", recorder.matches(CacheCategory.TILE, "Put item in cache"));

    // first run, this should put things in the cache
    recorder.clear();
    tmd.setCode(new TileCode(1,0,1));
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
    Assert.assertEquals("<g id=\"beans.features.1-0-1\"/>", tile.getFeatureContent());
    Assert.assertEquals("", recorder.matches(CacheCategory.FEATURE, "Put item in cache"));
    Assert.assertEquals("", recorder.matches(CacheCategory.TILE, "Put item in cache"));

    // first run, this should put things in the cache
    recorder.clear();
    tmd.setCode(new TileCode(1,1,1));
    tmd.setScale(2.0);
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
    Assert.assertEquals("<g id=\"beans.features.1-1-1\"><g style=\"fill:#995500;fill-opacity:0.6;stroke:#995500;stroke-opacity:0.3;stroke-width:1px;\" id=\"beans.features.1-1-1.0\"><path fill-rule=\"evenodd\" d=\"M4 -2l8 0 2 -2 -10 0 0 2 Z\" id=\"3\"/></g></g>", tile.getFeatureContent());
    Assert.assertEquals("", recorder.matches(CacheCategory.FEATURE, "Put item in cache"));
    Assert.assertEquals("", recorder.matches(CacheCategory.TILE, "Put item in cache"));

    // get tile again, the result should be different because we changed the cached value
    recorder.clear();
    tmd.setCode(new TileCode(1,1,0));
    tmd.setScale(1.0);
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
    Assert.assertEquals("<g id=\"beans.features.1-1-0\"><g style=\"fill:#995500;fill-opacity:0.6;stroke:#995500;stroke-opacity:0.3;stroke-width:1px;\" id=\"beans.features.1-1-0.0\"><path fill-rule=\"evenodd\" d=\"M4 0l2 0 0 -3 -2 0 0 3 Z\" id=\"2\"/></g></g>", tile.getFeatureContent());
    Assert.assertEquals("", recorder.matches(CacheCategory.TILE, "Got item from cache"));
    Assert.assertEquals("", recorder.matches(CacheCategory.FEATURE));
View Full Code Here

Examples of org.geomajas.command.dto.GetVectorTileRequest

  }

  @Test
  public void testGetTile() throws Exception {
    InternalTile tile;
    TileMetadata tmd = new GetVectorTileRequest();
    tmd.setCrs("EPSG:4326");
    tmd.setCode(new TileCode(1,0,1));
    tmd.setLayerId(LAYER_BEANS);
    tmd.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    tmd.setScale(1.0);
    tmd.setPanOrigin(new Coordinate(0, 0));

    // first run, this should put things in the cache
    recorder.clear();
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
    Assert.assertEquals("<g id=\"beans.features.1-0-1\"/>", tile.getFeatureContent());
    Assert.assertEquals("", recorder.matches(CacheCategory.FEATURE, "Put item in cache"));
    Assert.assertEquals("", recorder.matches(CacheCategory.TILE, "Put item in cache"));

    // verify that data is in the cache
    DummyCacheService cache = (DummyCacheService) cacheManager.getCacheForTesting(LAYER_BEANS, CacheCategory.TILE);
    Assert.assertEquals(1, cache.size());
    TileCacheContainer tcc = (TileCacheContainer) cache.getObject();
    tcc.getTile().setFeatureContent("<dummy />");

    // get tile again, the result should be different because we changed the cached value
    recorder.clear();
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
    Assert.assertEquals("<dummy />", tile.getFeatureContent());
    Assert.assertEquals("", recorder.matches(CacheCategory.TILE, "Got item from cache"));
    Assert.assertEquals("", recorder.matches(CacheCategory.FEATURE));

    // ask for different layer, should not be found in cache as context is different
    recorder.clear();
    tmd.setLayerId(LAYER_COUNTRIES);
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
    //Assert.assertEquals(4, features.size());
    Assert.assertEquals("", recorder.matches(CacheCategory.FEATURE, "Put item in cache"));
    Assert.assertEquals("", recorder.matches(CacheCategory.TILE, "Put item in cache"));
View Full Code Here

Examples of org.geomajas.command.dto.GetVectorTileRequest

  }

  @Test
  public void testGetTileCheckFeatureStringCache() throws Exception {
    InternalTile tile;
    TileMetadata tmd = new GetVectorTileRequest();
    tmd.setCrs("EPSG:4326");
    tmd.setCode(new TileCode(1,0,1));
    tmd.setLayerId(LAYER_BEANS);
    tmd.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    tmd.setScale(1.0);
    tmd.setPanOrigin(new Coordinate(0, 0));

    // first run, this should put things in the cache
    recorder.clear();
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
View Full Code Here

Examples of org.geomajas.command.dto.GetVectorTileRequest

   * @throws Exception oops
   */
  @Test
  public void testGetTileWithTransformationCheckFeatureCache() throws Exception {
    InternalTile tile;
    TileMetadata tmd = new GetVectorTileRequest();
    tmd.setCrs("EPSG:900913");
    tmd.setCode(new TileCode(1,1,1));
    tmd.setLayerId(LAYER_BEANS);
    tmd.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    tmd.setScale(1.0);
    tmd.setPanOrigin(new Coordinate(0, 0));

    // first run, this should put things in the cache
    recorder.clear();
    tile = vectorLayerService.getTile(tmd);
    Assert.assertNotNull(tile);
View Full Code Here

Examples of org.geomajas.command.dto.GetVectorTileRequest

  }

  @Test
  public void testGetTile() throws Exception {
    InternalTile tile;
    TileMetadata tileMetadata = new GetVectorTileRequest();
    tileMetadata.setCode(new TileCode(2, 1, 1));
    tileMetadata.setCrs(beanLayer.getLayerInfo().getCrs());
    tileMetadata.setLayerId(LAYER_ID);
    tileMetadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    tileMetadata.setScale(1);
    tileMetadata.setPanOrigin(new Coordinate(0,0));

    login("luc");
    recorder.clear();
    tile = layerService.getTile(tileMetadata);
    Assert.assertTrue(tile.getFeatureContent().contains("path"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.