Create the affine transform that maps from the world (map) projection to the pixel on the printed map.

@param mapContext the map context
517563
public static AffineTransform getWorldToScreenTransform(final MapfishMapContext mapContext) {
        return RendererUtilities.worldToScreenTransform(mapContext.toReferencedEnvelope(),
                                                        mapContext.getPaintArea());
    }
497589
public static Mirage newNinePatchContaining(NinePatch ninePatch, Rectangle content)
    {
        Rectangle bounds = ninePatch.getBoundsSurrounding(content);

        Mirage mirage = new NinePatchMirage(ninePatch, bounds.width, bounds.height);
        return new TransformedMirage(mirage,
            AffineTransform.getTranslateInstance(bounds.x, bounds.y), false);
    }
465254
public static PixelTransform<Point2D_F32> createPixelTransform(InvertibleTransform transform) {
		PixelTransform<Point2D_F32> pixelTran;
		if( transform instanceof Homography2D_F64) {
			Homography2D_F32 t = ConvertFloatType.convert((Homography2D_F64) transform, null);
			pixelTran = new PixelTransformHomography_F32(t);
		} else if( transform instanceof Homography2D_F32) {
				pixelTran = new PixelTransformHomography_F32((Homography2D_F32)transform);
		} else if( transform instanceof Affine2D_F64) {
			Affine2D_F32 t = UtilAffine.convert((Affine2D_F64) transform, null);
			pixelTran = new PixelTransformAffine_F32(t);
		} else if( transform instanceof Affine2D_F32) {
			pixelTran = new PixelTransformAffine_F32((Affine2D_F32)transform);
		} else {
			throw new RuntimeException("Unknown model type");
		}
		return pixelTran;
	}
1207883
public static Map<String, String> flattenDataContext(final Map<String, Map<String, String>> dataContext) {
        final Map<String, String> res = new HashMap<String, String>();
        if(null!=dataContext){
            for (final Map.Entry<String, Map<String, String>> entry : dataContext.entrySet()) {

                final String p = entry.getKey() + ".";
                final Map<String, String> map = entry.getValue();
                if(null!=map){
                    for (final Map.Entry<String, String> entry2 : map.entrySet()) {
                        if(null!=map.get(entry2.getKey())){
                            res.put(p + entry2.getKey(), entry2.getValue());
                        }
                    }
                }
            }
        }
        return res;
    }
718510
public MAP inboundMap(Map<String, Object> ctx)
   {
      AddressingProperties implementation = (AddressingProperties)ctx.get(CXFMAPConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
      return newMap(implementation);
   }
1279775
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WTemplate template = (WTemplate) component;

		// Setup the context
		Map<String, Object> context = new HashMap<>();
		// Make the component available under the "wc" key.
		context.put("wc", template);
		// Load the parameters
		context.putAll(template.getParameters());

		// Get template renderer for the engine
		String engine = template.getEngineName();
		if (Util.empty(engine)) {
			engine = ConfigurationProperties.getDefaultRenderingEngine();
		}
		TemplateRenderer templateRenderer = TemplateRendererFactory.newInstance(engine);

		// Render
		if (!Util.empty(template.getTemplateName())) {
			// Render the template
			templateRenderer.renderTemplate(template.getTemplateName(), context, template.getTaggedComponents(), renderContext.getWriter(),
					template.getEngineOptions());
		} else if (!Util.empty(template.getInlineTemplate())) {
			// Render inline
			templateRenderer.renderInline(template.getInlineTemplate(), context, template.getTaggedComponents(), renderContext.getWriter(),
					template.getEngineOptions());
		}
	}
730178
function ProjectionHelperOverlay(map) {

  this.setMap(map);

  var TILEFACTOR = 8;
  var TILESIDE = 1 << TILEFACTOR;
  var RADIUS = 7;

  this._map = map;
  this._zoom = -1;
  this._X0 =
  this._Y0 =
  this._X1 =
  this._Y1 = -1;


}
78390
@Override
	public void transform(Transform3D transform) {
		if (transform!=null) {
			Point3D p = new Point3f();
			for(int i=0; i<this.numCoords;) {
				p.set(this.coords[i], this.coords[i+1], this.coords[i+2]);
				transform.transform(p);
				this.coords[i++] = p.getX();
				this.coords[i++] = p.getY();
				this.coords[i++] = p.getZ();
			}
			this.graphicalBounds = null;
			this.logicalBounds = null;
		}
	}
1363523
public EventBuilder withContexts(Map<String, Map<String, Object>> contexts) {
        event.setContexts(contexts);
        return this;
    }
7233
public void paint(Paintable paintable, Object group, MapContext context) {
		RasterTile tile = (RasterTile) paintable;
		context.getRasterContext().drawImage(tile.getStore().getLayer(), 
				tile.getCode().toString(), tile.getUrl(), tile.getBounds(), new PictureStyle(1.0));
	}
11883
public void setContextProperties(Map<String, String> contextProperties)
   {
      if (contextProperties != null) {
         this.contextProperties = new HashMap<String, String>(4);
         this.contextProperties.putAll(contextProperties);
      }
   }
124996
private VelocityContext toContext(Map<?, ?> bindingMap) {
		final Map<String, Object> map = Convert.convert(new TypeReference<Map<String, Object>>() {}, bindingMap);
		return new VelocityContext(map);
	}
1353758
function(map) {
        /**
         * If nothing to do with resolutions has been set, assume a single
         * resolution determined by ratio*extent/size - if an image has a
         * pixel aspect ratio different than one (as calculated above), the
         * image will be stretched in one dimension only.
         */
        if( this.options.maxResolution == null ) {
            this.options.maxResolution = this.aspectRatio *
                                         this.extent.getWidth() /
                                         this.size.w;
        }
        OpenLayers.Layer.prototype.setMap.apply(this, arguments);
    }
1251232
@Override
	public void paint(final RenderContext renderContext) {

		if (!doTransform) {
			super.paint(renderContext);
			return;
		}

		if (!(renderContext instanceof WebXmlRenderContext)) {
			LOG.warn("Unable to transform a " + renderContext);
			super.paint(renderContext);
			return;
		}
		LOG.debug("Transform XML Interceptor: Start");

		UIContext uic = UIContextHolder.getCurrent();

		// Set up a render context to buffer the XML payload.
		StringWriter xmlBuffer = new StringWriter();
		PrintWriter xmlWriter = new PrintWriter(xmlBuffer);

		WebXmlRenderContext xmlContext = new WebXmlRenderContext(xmlWriter, uic.getLocale());

		super.paint(xmlContext);  // write the XML to the buffer

		// Get a handle to the true PrintWriter.
		WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext;
		PrintWriter writer = webRenderContext.getWriter();

		/*
		 * Switch the response content-type to HTML.
		 * In theory the transformation could be to ANYTHING (not just HTML) so perhaps it would make more sense to
		 *    write a new interceptor "ContentTypeInterceptor" which attempts to sniff payloads and choose the correct
		 *    content-type. This is exactly the kind of thing IE6 loved to do, so perhaps it's a bad idea.
		 */
		Response response = getResponse();
		response.setContentType(WebUtilities.CONTENT_TYPE_HTML);

		String xml = xmlBuffer.toString();
		if (isAllowCorruptCharacters() && !Util.empty(xml)) {
			// Remove illegal HTML characters from the content before transforming it.
			xml = removeCorruptCharacters(xml);
		}
		// Double encode template tokens in the XML
		xml = WebUtilities.doubleEncodeBrackets(xml);
		// Setup temp writer
		StringWriter tempBuffer = new StringWriter();
		PrintWriter tempWriter = new PrintWriter(tempBuffer);
		// Perform the transformation and write the result.
		transform(xml, uic, tempWriter);
		// Decode Double Encoded Brackets
		String tempResp = tempBuffer.toString();
		tempResp = WebUtilities.doubleDecodeBrackets(tempResp);
		// Write response
		writer.write(tempResp);

		LOG.debug("Transform XML Interceptor: Finished");
	}
54226
public void paint(Paintable paintable, Object group, MapContext context) {
		VectorLayer layer = (VectorLayer) paintable;
		PictureStyle opacityStyle = new PictureStyle(layer.getOpacity());

		// Create the needed groups in the correct order:
		context.getVectorContext().drawGroup(mapWidget.getGroup(RenderGroup.VECTOR), layer, opacityStyle);
		context.getVectorContext().drawGroup(layer, layer.getFeatureGroup());
		context.getVectorContext().drawGroup(layer, layer.getSelectionGroup());
		FontStyle labelStyle = getLabelFontstyle(layer);
		context.getVectorContext().drawGroup(layer, layer.getLabelGroup(), labelStyle);

		// Create the needed groups in the correct order:
		context.getRasterContext().drawGroup(mapWidget.getGroup(RenderGroup.RASTER), layer, opacityStyle);
		context.getRasterContext().drawGroup(layer, layer.getFeatureGroup());
		context.getRasterContext().drawGroup(layer, layer.getLabelGroup());

		// Draw symbol types, as these can change any time:
		LayerType layerType = layer.getLayerInfo().getLayerType();
		if (LayerType.POINT == layerType || LayerType.MULTIPOINT == layerType || LayerType.GEOMETRY == layerType) {
			for (FeatureStyleInfo style : layer.getLayerInfo().getNamedStyleInfo().getFeatureStyles()) {
				context.getVectorContext().drawSymbolDefinition(null, style.getStyleId(), style.getSymbol(),
						new ShapeStyle(style), null);
			}
		}

		// Check layer visibility:
		if (layer.isShowing()) {
			context.getVectorContext().unhide(layer);
			context.getRasterContext().unhide(layer);
		} else {
			context.getVectorContext().hide(layer);
			context.getRasterContext().hide(layer);
		}

		// Check label visibility:
		if (layer.isLabelsShowing()) {
			context.getVectorContext().unhide(layer.getLabelGroup());
			context.getRasterContext().unhide(layer.getLabelGroup());
		} else {
			context.getVectorContext().hide(layer.getLabelGroup());
			context.getRasterContext().hide(layer.getLabelGroup());
		}
	}
339869
private TileBitmap createBackgroundBitmap(RenderContext renderContext) {
        TileBitmap bitmap = this.graphicFactory.createTileBitmap(renderContext.rendererJob.tile.tileSize, renderContext.rendererJob.hasAlpha);
        renderContext.canvasRasterer.setCanvasBitmap(bitmap);
        if (!renderContext.rendererJob.hasAlpha) {
            renderContext.canvasRasterer.fill(renderContext.renderTheme.getMapBackgroundOutside());
        }
        return bitmap;

    }
1203704
function(map) {        
        OpenLayers.Layer.prototype.setMap.apply(this, arguments);

        if (!this.renderer) {
            this.map.removeLayer(this);
        } else {
            this.renderer.map = this.map;

            var newSize = this.map.getSize();
            newSize.w = newSize.w * this.ratio;
            newSize.h = newSize.h * this.ratio;
            this.renderer.setSize(newSize);
        }
    }