@Override protected MapComponentInfo buildMap() { ViewPort viewPort = mapPresenter.getViewPort(); double printWidth = getPageWidth() - 2 * marginX; double printHeight = getPageHeight() - 2 * marginY; Bbox fittingBox = createFittingBox(viewPort.getBounds(), printWidth / printHeight); MapComponentInfo map = super.buildMap(fittingBox); map.getLayoutConstraint().setMarginX(marginX); map.getLayoutConstraint().setMarginY(marginY); map.setLocation(new org.geomajas.geometry.Coordinate(fittingBox.getX(), fittingBox.getY())); map.setPpUnit((float) (printWidth / fittingBox.getWidth())); map.setTag("map"); // GWT:map.setMapId(mapModel.getMapInfo().getId()); // Old puregwt: map.setMapId(mapPresenter.getConfiguration().getId()); map.setMapId(mapPresenter.getConfiguration().getServerConfiguration().getId()); map.setApplicationId(applicationId); map.setRasterResolution(rasterDpi); // use rasterized layers for pure GWT double rasterScale = map.getPpUnit() * map.getRasterResolution() / 72.0; // map.getPpUnit() = aantal pixels per map unit bij 72 dpi mapBuilder.build(mapPresenter, fittingBox, rasterScale); List<PrintComponentInfo> layers = new ArrayList<PrintComponentInfo>(); RasterizedLayersComponentInfo rasterizedLayersComponentInfo = new RasterizedLayersComponentInfo(); rasterizedLayersComponentInfo.setMapInfo(mapPresenter.getConfiguration().getServerConfiguration()); layers.add(rasterizedLayersComponentInfo); map.getChildren().addAll(0, layers); return map; }
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.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();