[OpenLayers-Users] GetFeature and reprojection GET Method

afrozk afrozk at gmail.com
Tue Jan 19 04:10:48 EST 2010


See if this helps,

I have a wms layer(in epsg 4326)  over the google base layer
I use GetFeatureInfo to get the data nd it works fine for me

var extent     = new
OpenLayers.Bounds(-4037508.34,-20037508.34,20037508.34,20037508.34);
var map_options   = {'maxExtent': extent,numZoomLevels:6,restrictedExtent:
extent,projection: new
OpenLayers.Projection("EPSG:900913"),displayProjection: new
OpenLayers.Projection("EPSG:4326")}
var coverage_options  = {isBaseLayer: false, opacity:
0.4,displayInLayerSwitcher: true};
var google_Poptions   = {isBaseLayer: true, displayInLayerSwitcher:
true,sphericalMercator: true ,reproject: true,type: G_PHYSICAL_MAP};

// Inside init
map = new OpenLayers.Map( 'map', map_options);
google = new OpenLayers.Layer.Google("Google Physical",google_Poptions);
   region1_layer  = new OpenLayers.Layer.WMS( "Region1 ",
                    "http://" + server + "/cgi-bin/mapserv.exe?",
                    {map:'../htdocs/mgt/c1.map',layers:
"region1",transparent: "TRUE", format: "image/png" ,counter1:0},
     coverage_options);
map.addLayers([google,region1_layer]);

Thanks

On Tue, Jan 19, 2010 at 12:37 PM, Christoph Ratke [via OSGeo.org] <
ml-node+4418761-2087755637 at n2.nabble.com<ml-node%2B4418761-2087755637 at n2.nabble.com>
> wrote:

> Hi all,
>
> I am trying to realize a GetFeature request on EPSG:4326 WFS 1.0.0 data
> over a EPSG:900913 projected Google base layer. As another restriction I
> have to use the http GET method.
>
> I got the WFS overlay working like this:
>     var p = new OpenLayers.Protocol.HTTP({
>         url: "wfsURL",
>         ...some more params...
>         format: new OpenLayers.Format.GML(
>         {
>           internalProjection:mapProjection,
>           externalProjection:displayProjection
>         })
>     });
>     var l = new OpenLayers.Layer.Vector("GML",
>         {strategies: [new OpenLayers.Strategy.Fixed({preload:false})],
>          protocol: p
>         });
> Maybe the WFS Layer is looking a bit strange but it was the only way to
> get it up and running. Anyway using the getFeatureControl is not working
> because the bounding box is not reprojected. It is requested in
> EPSG:900913 but I need a EPSG:4326 BBox).
> I was not able to reproject the BBox myself. How could I do so? Do you
> have any suggestions?
>
> Thank you in advance.
> Christoph
>
>
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=4418761&i=0>
> http://openlayers.org/mailman/listinfo/users
>
>
> ------------------------------
> View message @
> http://n2.nabble.com/SelectFeature-on-Overlapping-Layers-tp4412919p4418761.html
> To unsubscribe from Re: SelectFeature on Overlapping Layers, click here< (link removed) ==>.
>
>
>

-- 
View this message in context: http://n2.nabble.com/SelectFeature-on-Overlapping-Layers-tp4412919p4418896.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100119/218ce6c1/attachment.html


More information about the Users mailing list