[OpenLayers-Users] using a proxy

Guillaume Sueur guillaume.sueur at neogeo-online.net
Thu Aug 21 04:55:04 EDT 2008


Hi Laurent !

I think you should use a global setting like :
OpenLayers.ProxyHost='/cgi-bin/proxy.cgi/?url=';

Good luck !

Will we see you at FOSS4G ?

Guillaume

LaurentPierre a écrit :
> Hi,
> 
> I'm trying to use a proxy with openlayers in order to request ws on
> different ports than the site (on the same machine in facts).  In order to
> do that I set the proxy in the code but not all the calls are made through
> it  :
> 
> var url =  map.layers[0].getFullRequestString(.....  generates a call
> through the proxy 
> while this one
> new OpenLayers.Layer.WMS("edfgeo:departement - Tiled",
> "http://localhost:8080/geoserver/wms", ....
> no.
> 
> Here's the 2 firebug traces :
> 
> http://localhost/cgi-bin/proxy.py?url=http%3A%2F%2Flocalhost%3A8080%2Fgeoserver%2Fwms%3FSTYLES%3D%26LAYERS%3Dedfgeo%253Apactedep%26WIDTH%3D800%26HEIGHT%3D560%26SRS%3DEPSG%253A2154%26FORMAT%3Dimage%252Fpng%26SERVICE%3DWMS%26VERSION%3D1.1.1%26REQUEST%3DGetFeatureInfo%26EXCEPTIONS%3Dapplication%252Fvnd.ogc.se_xml%26BBOX%3D753290.28095%252C6200497.152087%252C899406.792137%252C6302778.709918%26X%3D55%26Y%3D119%26INFO_FORMAT%3Dtext%252Fhtml%26QUERY_LAYERS%3Dedfgeo%253Adepartement%26FEATURE_COUNT%3D50
> 
> http://localhost:8080/geoserver/wms?STYLES=&LAYERS=edfgeo%3Apactedep&WIDTH=1200&HEIGHT=840&SRS=EPSG%3A2154&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&BBOX=825492.3851108723,6251038.624999397,827204.6879763438,6252237.237005227
> 
> and a code fragment :
> 
> 		
> .......
> 	function showName(e){
> 			var url =  map.layers[0].getFullRequestString(
>                     {
>                         REQUEST: "GetFeatureInfo",
>                         EXCEPTIONS: "application/vnd.ogc.se_xml",
>                         BBOX: map.getExtent().toBBOX(),
>                         X: e.xy.x,
>                         Y: e.xy.y,
>                         INFO_FORMAT: 'text/html',
>                         QUERY_LAYERS: map.layers[2].params.LAYERS,
>                         FEATURE_COUNT: 50,
>                         WIDTH: map.size.w,
>                         HEIGHT: map.size.h
>                     },
>                     "http://localhost:8080/geoserver/wms"
>                 );
> .......
>         function init(){
> 	    OpenLayers.ProxyHost="/cgi-bin/proxy.py?url=";
> 
> 	    toolTip = document.getElementById("toolTip");
> 
>             var bounds = new OpenLayers.Bounds(
>                 -82496.16303893644, 5966463.161241372,
>                 1413736.911514963, 7198720.496439878
>             );
>             var options = {
>                 controls: [],
>                 maxExtent: bounds,
>                 maxResolution: 5844.66044747617,
>                 projection: "EPSG:2154",
>                 units: 'm'
>             };
>             map = new OpenLayers.Map('map', options);
>             
>             
>             // setup tiled layer
>             tiled = new OpenLayers.Layer.WMS(
>                 "edfgeo:departement - Tiled",
> "http://localhost:8080/geoserver/wms",
>                 {
>                     styles: '',
>                     layers: 'edfgeo:departement',
>                     width: '800',
>                     height: '618',
>                     srs: 'EPSG:2154',
>                     format: 'image/png',
>                     tiled: 'true',
>                     tilesOrigin : "-82496.16303893644,5966463.161241372"
>                 },
>                 {buffer: 0} 
>             );
> .......
> 
> 
> Is it a known problem or did I make a mistake ?
> 
> Thanks
> 
> Laurent Pierre
> 





More information about the Users mailing list