[OpenLayers-Users] Conversion of BBox for GetFeature Request

Jerome A. Wendell jawendell at digitalmapping.com
Tue Mar 5 19:52:42 PST 2013


I failed to add the following to my previous post:

 

var geographic = new OpenLayers.Projection("EPSG:4326");

var mercator = new OpenLayers.Projection("EPSG:900913");

 

Thanks.

 

 

From: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Jerome A.
Wendell
Sent: Tuesday, March 05, 2013 9:37 PM
To: OpenLayers User List
Subject: [OpenLayers-Users] Conversion of BBox for GetFeature Request

 

I read several posts on this topic, and have attempted to convert the
coordinates of the BBox from 900913 to 4326, which is the system for the
layer the GetFeature request is posted for.  The request is still being sent
in 900913 coordinates, and no features are being returned.  I am new to
OpenLayers, and I have probably interpreted the information in the posts and
the documentation incorrectly.  Any suggestions that you may have concerning
what I am doing wrong are greatly appreciated.  The code that I am using is
below:

 

OpenLayers.Control.myGetFeature =
OpenLayers.Class(OpenLayers.Control.GetFeature,{

                                                               selectBox:
function(position){

 
var newbounds = new
OpenLayers.Control.GetFeature.prototype.selectBox.apply(this,
transform(mercator,geographic).toBBox(null,mybaselayer.reverseAxisOrder()));

 
this.request(newbounds);

                                                               },

                                                    CLASS_NAME:
'OpenLayers.Control.myGetFeature'

                                });

 

        var myControl = new OpenLayers.Control.myGetFeature({

            protocol: OpenLayers.Protocol.WFS.fromWMSLayer(mylayer),

                                box: false,

                                hover: false,

                                maxFeatures: 20

                });

 

                myControl.events.register("featureselected", this,
function(e) {

                                highlightLayer.addFeatures(e.features);

                });

 

                myControl.events.register("featureunselected", this,
function(e) {

                                highlightLayer.removeFeatures(e.features);

                });

 

                map.addControl(myControl);

                myControl.activate();

 

Thanks in advance for your help.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130305/c5f2b8d7/attachment-0001.html>


More information about the Users mailing list