I have OpenLayers ProxyHost configured
OpenLayers.ProxyHost= "form/proxy?url=";
, the url
config of Mapfish Print Provider is configured as http://path/to/mapfish/print
, and the doc tells that I can do that as it is accessible throug the proxy
This property requires that the print service is at the same origin as the application (or accessible via proxy).
, but the lib still tries to go to other origin directly and fails.
I cannot find where to configure GeoExt or ExtJS to go there through proxy.
The Mapfish Print doc tells to set some parameter of a mapfish
variable, I did that but obviously with no success.
Please, help!
(Actually, it's GeoExt 2 for ExtJS 4, where the PrintProvider seems being renamed as GeoExt.data.MapfishPrintProvider)
Best Answer
Adding the
OpenLayers.ProxyHost
will only proxy requests that OpenLayers itself makes and won't proxy requests from the GeoExt framework. But actually you do not need to use a proxy as you can put the request for the Print Capabilities into your page's header as a script tag like this:Then all you need to do in your print provider is reference the
printCapabilities
variable like this:Then all requests for printing should work as the url is stored in the printCapabilities object. This is the approach I use for printing from my web appications.