Package org.geomajas.configuration.client

Examples of org.geomajas.configuration.client.ClientMapInfo


    ClientGeometryLayerInfo geo = new ClientGeometryLayerInfo();
    geo.getGeometries().add(createPolygon());
    geo.setStyle(createPolygonStyle());
    geo.setLayerType(LayerType.POLYGON);

    ClientMapInfo mapInfo = new ClientMapInfo();
    mapInfo.setCrs("EPSG:4326");
    MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
    mapRasterizingInfo.setBounds(new Bbox(0, 0, 100, 100));
    mapRasterizingInfo.setScale(1);
    mapRasterizingInfo.setTransparent(true);
    mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo);

    DefaultMapContext mapContext = new DefaultMapContext();
    mapContext.setCoordinateReferenceSystem(geoService.getCrs2("EPSG:4326"));
    mapContext.getViewport().setBounds(
        new ReferencedEnvelope(0, 100, 0, 100, mapContext.getCoordinateReferenceSystem()));
View Full Code Here


      bbox = createBbox();
      if (log.isDebugEnabled()) {
        log.debug("rendering" + getLayerId() + " to [" + bbox.getMinX() + " " + bbox.getMinY() + " "
            + bbox.getWidth() + " " + bbox.getHeight() + "]");
      }
      ClientMapInfo map = configurationService.getMapInfo(getMap().getMapId(), getMap().getApplicationId());
      try {
        tiles = rasterLayerService.getTiles(getLayerId(), geoService.getCrs2(map.getCrs()), bbox, rasterScale);
        if (tiles.size() > 0) {
          Collection<Callable<ImageResult>> callables = new ArrayList<Callable<ImageResult>>(tiles.size());
          // Build the image downloading threads
          for (RasterTile tile : tiles) {
            RasterImageDownloadCallable downloadThread = new RasterImageDownloadCallable(
View Full Code Here

  protected void initializationCallback(GetMapConfigurationResponse r) {
    if (r.getMapInfo() != null && !mapModel.isInitialized()) {
      // must be called before anything else !
      addChild(graphics);
      render(mapModel, null, RenderStatus.ALL);
      ClientMapInfo info = r.getMapInfo();
      unitLength = info.getUnitLength();
      pixelLength = info.getPixelLength();
      graphics.setBackgroundColor(info.getBackgroundColor());
      mapModel.initialize(info);
      setNavigationAddonEnabled(info.isPanButtonsEnabled());
      setScalebarEnabled(info.isScaleBarEnabled());
      painterVisitor.registerPainter(new FeaturePainter(new ShapeStyle(info.getPointSelectStyle()),
          new ShapeStyle(info.getLineSelectStyle()), new ShapeStyle(info.getPolygonSelectStyle())));

      for (final Layer<?> layer : mapModel.getLayers()) {
        layer.addLayerChangedHandler(new LayerChangedHandler() {

          public void onLabelChange(LayerLabeledEvent event) {
View Full Code Here

  public ClientMapInfo securityClone(ClientMapInfo original) {
    // the data is explicitly copied as this assures the security is considered when copying.
    if (null == original) {
      return null;
    }
    ClientMapInfo client = new ClientMapInfo();
    client.setBackgroundColor(original.getBackgroundColor());
    client.setCrs(original.getCrs());
    client.setDisplayUnitType(original.getDisplayUnitType());
    client.setId(original.getId());
    client.setInitialBounds(original.getInitialBounds());
    client.setPreferredPixelsPerTile(original.getPreferredPixelsPerTile());
    List<ClientLayerInfo> layers = new ArrayList<ClientLayerInfo>();
    client.setLayers(layers);
    for (ClientLayerInfo layer : original.getLayers()) {
      ClientLayerInfo clientLayer = securityClone(layer);
      if (null != clientLayer) {
        layers.add(clientLayer);
      }
    }
    client.setLayerTree(securityClone(original.getLayerTree()));
    client.setLineSelectStyle(original.getLineSelectStyle());
    client.setMaxBounds(original.getMaxBounds());
    client.setScaleConfiguration(original.getScaleConfiguration());
    client.setPanButtonsEnabled(original.isPanButtonsEnabled());
    client.setPixelLength(original.getPixelLength());
    client.setPointSelectStyle(original.getPointSelectStyle());
    client.setPolygonSelectStyle(original.getPolygonSelectStyle());
    client.setPrecision(original.getPrecision());
    client.setScaleBarEnabled(original.isScaleBarEnabled());
    client.setToolbar(securityClone(original.getToolbar()));
    client.setUnitLength(original.getUnitLength());
    client.setUserData(original.getUserData());
    client.setWidgetInfo(original.getWidgetInfo());
    return client;
  }
View Full Code Here

  private MapModel mapModel;

  public TestSequenceProcessor() {
    mapModel = new MapModel("foobar");
    ClientMapInfo info = new ClientMapInfo();
    info.setCrs("EPSG:4326");
    info.setInitialBounds(new Bbox(0, 0, 180, 180));

    ClientVectorLayerInfo layerInfo = new ClientVectorLayerInfo();
    VectorLayerInfo serverInfo = new VectorLayerInfo();
    serverInfo.setLayerType(LayerType.POLYGON);
    layerInfo.setLayerInfo(serverInfo);
    layerInfo.setMaxExtent(new Bbox(0, 0, 180, 180));
    layerInfo.setServerLayerId("test");
    layerInfo.setId("testLayer");
    List<ClientLayerInfo> layers = new ArrayList<ClientLayerInfo>();
    layers.add(layerInfo);
    info.setLayers(layers);

    mapModel.initialize(info);
    mapModel.selectLayer(mapModel.getLayer("testLayer"));

    Feature feature = new Feature();
View Full Code Here

TOP

Related Classes of org.geomajas.configuration.client.ClientMapInfo

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.