/** * Retrieve the list of ClientWidgetInfo's from a userapplications overview map. This consists of the widget infos * defined in the UserApplication itself, and those defined in the {@link UserApplicationInfo#getApplicationInfo()}. * * @param uai the user application info * @return List of ClientWidgetInfo as defined in the user application */ public static Map<String, ClientWidgetInfo> getOverviewMapClientWidgetInfo(UserApplicationInfo uai) { Map<String, ClientWidgetInfo> widgetInfos = new HashMap<String, ClientWidgetInfo>(); for (ClientMapInfo cmi : uai.getApplicationInfo().getMaps()) { if (GdmLayout.MAPOVERVIEW_ID.equals(cmi.getId())) { widgetInfos.putAll(cmi.getWidgetInfo()); } } widgetInfos.putAll(uai.getMainMapWidgetInfos()); return widgetInfos; }
/** * Retrieve the list of ClientWidgetInfo's from the userapplication's overview map. used. * * @param userApplication * the userapplication * @return List of ClientWidgetInfo as defined in the userapplication */ public static Map<String, ClientWidgetInfo> getOverviewMapClientWidgetInfo(UserApplicationInfo userApplication) { Map<String, ClientWidgetInfo> widgetInfos = new HashMap<String, ClientWidgetInfo>(); for (ClientMapInfo mapInfo : userApplication.getApplicationInfo().getMaps()) { if (mapInfo.getId().equals(GdmLayout.MAPOVERVIEW_ID)) { widgetInfos.putAll(mapInfo.getWidgetInfo()); } } widgetInfos.putAll(userApplication.getOverviewMapWidgetInfos()); return widgetInfos; }
/** * Retrieve the list of ClientWidgetInfo's from a userapplications main map. This consists of the widget infos * defined in the UserApplication itself, and those defined in the {@link UserApplicationInfo#getApplicationInfo()}. * * @param uai the user application info * @return List of ClientWidgetInfo as defined in the user application */ public static Map<String, ClientWidgetInfo> getMainMapClientWidgetInfo(UserApplicationInfo uai) { Map<String, ClientWidgetInfo> widgetInfos = new HashMap<String, ClientWidgetInfo>(); for (ClientMapInfo cmi : uai.getApplicationInfo().getMaps()) { if (GdmLayout.MAPMAIN_ID.equals(cmi.getId())) { widgetInfos.putAll(cmi.getWidgetInfo()); } } widgetInfos.putAll(uai.getMainMapWidgetInfos()); return widgetInfos; }
/** * Retrieve the list of ClientWidgetInfo's from the userApplication's main map. * * @param userApplication * the userapplication * @return List of ClientWidgetInfo as defined in the userapplication */ public static Map<String, ClientWidgetInfo> getMainMapClientWidgetInfo(UserApplicationInfo userApplication) { Map<String, ClientWidgetInfo> widgetInfos = new HashMap<String, ClientWidgetInfo>(); for (ClientMapInfo mapInfo : userApplication.getApplicationInfo().getMaps()) { if (mapInfo.getId().equals(GdmLayout.MAPMAIN_ID)) { widgetInfos.putAll(mapInfo.getWidgetInfo()); } } widgetInfos.putAll(userApplication.getMainMapWidgetInfos()); return widgetInfos; }
mainMap.getWidgetInfo().putAll(userApplicationInfo.getMainMapWidgetInfos()); mainMap.getWidgetInfo().putAll(blueprint.getMainMapClientWidgetInfos()); mainMap.getWidgetInfo().putAll(geodesk.getMainMapClientWidgetInfos()); overviewMap.getWidgetInfo().putAll(userApplicationInfo.getOverviewMapWidgetInfos()); overviewMap.getWidgetInfo().putAll(blueprint.getOverviewMapClientWidgetInfos()); overviewMap.getWidgetInfo().putAll(geodesk.getOverviewMapClientWidgetInfos());
@Override public void render(PdfContext context) { try { bbox = createBbox(); MapRasterizingInfo mapRasterizingInfo = (MapRasterizingInfo) clientMapInfo .getWidgetInfo(MapRasterizingInfo.WIDGET_KEY); mapRasterizingInfo.setBounds(new Bbox(bbox.getMinX(), bbox.getMinY(), bbox.getWidth(), bbox.getHeight())); mapRasterizingInfo.setScale(getMap().getPpUnit()); Graphics2D graphics = context.getGraphics2D(getBounds()); imageService.writeMap(graphics, clientMapInfo); graphics.dispose(); } catch (Exception e) { log.warn("Failed to render rasterized layers", e); } super.render(context); }
mainMap.getWidgetInfo().putAll(userApplicationInfo.getMainMapWidgetInfos()); mainMap.getWidgetInfo().putAll(blueprint.getMainMapClientWidgetInfos()); mainMap.getWidgetInfo().putAll(geodesk.getMainMapClientWidgetInfos()); overviewMap.getWidgetInfo().putAll(userApplicationInfo.getOverviewMapWidgetInfos()); overviewMap.getWidgetInfo().putAll(blueprint.getOverviewMapClientWidgetInfos()); overviewMap.getWidgetInfo().putAll(geodesk.getOverviewMapClientWidgetInfos());
protected void initialize() { themeInfo = (ThemesInfo) mapWidget.getMapModel().getMapInfo().getWidgetInfo(ThemesInfo.IDENTIFIER); buildWidget(); for (Layer<?> layer : mapWidget.getMapModel().getLayers()) { layer.addLayerChangedHandler(this); } // Set default viewConfig active is configured for (ViewConfigItem viewConfig : viewConfigItems) { if (viewConfig.getViewConfig().isActiveByDefault()) { activateViewConfig(viewConfig); } } }
protected MapRasterizingInfo buildMap(MapPresenter mapPresenter) { MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo(); ViewPort viewPort = mapPresenter.getViewPort(); mapRasterizingInfo.setBounds(viewPort.getBounds()); mapRasterizingInfo.setScale(viewPort.getScale()); mapRasterizingInfo.setTransparent(true); LegendRasterizingInfo legendRasterizingInfo = new LegendRasterizingInfo(); legendRasterizingInfo.setTitle("Legend"); FontStyleInfo font = new FontStyleInfo(); font.applyDefaults(); legendRasterizingInfo.setFont(font); mapRasterizingInfo.setLegendRasterizingInfo(legendRasterizingInfo); // Support for selection of layer object : create container for info on selected features; // store the selections layer per layer List<ClientLayerInfo> selectedLayers = new ArrayList<ClientLayerInfo>(); mapRasterizingInfo.setExtraLayers(selectedLayers); ClientMapInfo mapInfo = mapPresenter.getConfiguration().getServerConfiguration(); mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo); // Note: mapRasterizingInfo at this time is pretty empty (rastering info for // layers not yet filled in) return mapRasterizingInfo; }
private MapRasterizingInfo buildMap(MapPresenter mapPresenter) { MapRasterizingInfo mapRasterizingInfo = new MapRasterizingInfo(); ViewPort viewPort = mapPresenter.getViewPort(); mapRasterizingInfo.setBounds(viewPort.getBounds()); mapRasterizingInfo.setScale(1 / viewPort.getResolution()); mapRasterizingInfo.setTransparent(true); LegendRasterizingInfo legendRasterizingInfo = new LegendRasterizingInfo(); legendRasterizingInfo.setTitle("Legend"); FontStyleInfo font = new FontStyleInfo(); font.applyDefaults(); legendRasterizingInfo.setFont(font); mapRasterizingInfo.setLegendRasterizingInfo(legendRasterizingInfo); // Support for selection of layer object : create container for info on selected features; // store the selections layer per layer List<ClientLayerInfo> selectedLayers = new ArrayList<ClientLayerInfo>(); mapRasterizingInfo.setExtraLayers(selectedLayers); ClientMapInfo mapInfo = mapPresenter.getConfiguration().getHintValue(GeomajasServerExtension.MAPINFO); mapInfo.getWidgetInfo().put(MapRasterizingInfo.WIDGET_KEY, mapRasterizingInfo); // Note: mapRasterizingInfo at this time is pretty empty (rastering info for // layers not yet filled in) return mapRasterizingInfo; }
.getWidgetInfo(MapRasterizingInfo.WIDGET_KEY); ByteArrayOutputStream stream = new ByteArrayOutputStream(MAP_BUFFER_SIZE); ReportingCacheContainer container = new ReportingCacheContainer();