Package org.geomajas.gwt.client.map

Examples of org.geomajas.gwt.client.map.MapView


  }

  public void makeRasterizable(MapWidget map) {
    ClientMapInfo mapInfo = map.getMapModel().getMapInfo();
    MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo();
    MapView mapView = map.getMapModel().getMapView();
    mapRasterizingInfo.setBounds(GeometryConverter.toDto(map.getMapModel().getMapView().getBounds()));
    mapRasterizingInfo.setScale(mapView.getCurrentScale());
    mapRasterizingInfo.setTransparent(true);
    LegendRasterizingInfo legendRasterizingInfo = new LegendRasterizingInfo();
    legendRasterizingInfo.setTitle("Legend");
    FontStyleInfo font = new FontStyleInfo();
    font.applyDefaults();
View Full Code Here


  @Override
  protected MapComponentInfo buildMap() {
    MapComponentInfo map = super.buildMap();
    map.getLayoutConstraint().setMarginX(marginX);
    map.getLayoutConstraint().setMarginY(marginY);
    MapView view = mapModel.getMapView();
    double mapWidth = getPageWidth() - 2 * marginX;
    double mapHeight = getPageHeight() - 2 * marginY;
    Coordinate origin = view.getBounds().createFittingBox(mapWidth, mapHeight).getOrigin();
    map.setLocation(new org.geomajas.geometry.Coordinate(origin.getX(), origin.getY()));
    map.setPpUnit((float) (mapWidth / view.getBounds().createFittingBox(mapWidth, mapHeight).getWidth()));
    map.setTag("map");
    map.setMapId(mapModel.getMapInfo().getId());
    map.setApplicationId(applicationId);
    map.setRasterResolution(rasterDpi);
    List<PrintComponentInfo> layerChildren = new ArrayList<PrintComponentInfo>();
View Full Code Here

    this.zoomFactor = zoomFactor;
  }

  @Override
  public void onMouseUp(MouseUpEvent event) {
    MapView mapView = mapWidget.getMapModel().getMapView();
    WorldViewTransformer transformer = mapView.getWorldViewTransformer();
    Coordinate viewPosition = getScreenPosition(event);
    Coordinate worldPosition = transformer.viewToWorld(viewPosition);
    mapView.setCenterPosition(worldPosition);
    mapView.scale(zoomFactor, MapView.ZoomOption.LEVEL_CHANGE);
  }
View Full Code Here

   */
  private void updateMaxExtent() {
    if (targetMap.getMapModel().isInitialized()) {
      Bbox targetMaxBounds = getOverviewMaxBounds();

      MapView mapView = getMapModel().getMapView();

      // Set the maxBounds on this map as well:
      mapView.setMaxBounds(targetMaxBounds.buffer(targetMaxBounds.getWidth()));

      // apply buffer
      if (maxExtentIncreasePercentage > 0) {
        targetMaxBounds = targetMaxBounds
            .buffer(targetMaxBounds.getWidth() * maxExtentIncreasePercentage / 100);
      }

      // Then apply the map extent:
      mapView.applyBounds(targetMaxBounds, MapView.ZoomOption.LEVEL_FIT);
      super.onMapViewChanged(null);

      // Immediately draw or remove the max extent rectangle:
      setDrawTargetMaxExtent(drawTargetMaxExtent);
    }
View Full Code Here

  /**
   * Update the rectangle, and perhaps the entire map if needed.
   */
  private void updatePov() {
    MapView mapView = getMapModel().getMapView();
    WorldViewTransformer transformer = new WorldViewTransformer(mapView);
    Bbox targetBox = targetMap.getMapModel().getMapView().getBounds();
    Bbox overviewBox = mapView.getBounds();

    // check if bounds are valid
    if (Double.isNaN(overviewBox.getX())) {
      return;
    }
View Full Code Here

  @Override
  protected MapComponentInfo buildMap() {
    MapComponentInfo map = super.buildMap();
    map.getLayoutConstraint().setMarginX(marginX);
    map.getLayoutConstraint().setMarginY(marginY);
    MapView view = mapModel.getMapView();
    double mapWidth = getPageWidth() - 2 * marginX;
    double mapHeight = getPageHeight() - 2 * marginY;
    Coordinate origin = view.getBounds().createFittingBox(mapWidth, mapHeight).getOrigin();
    map.setLocation(new org.geomajas.geometry.Coordinate(origin.getX(), origin.getY()));
    map.setPpUnit((float) (mapWidth / view.getBounds().createFittingBox(mapWidth, mapHeight).getWidth()));
    map.setTag("map");
    map.setMapId(mapModel.getMapInfo().getId());
    map.setApplicationId(applicationId);
    map.setRasterResolution(rasterDpi);
    List<PrintComponentInfo> layers = new ArrayList<PrintComponentInfo>();
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.map.MapView

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.