[OpenLayers-Users] Conversion of BBox for GetFeature Request

Jerome A. Wendell jawendell at digitalmapping.com
Tue Mar 5 18:36:30 PST 2013


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/91b0be75/attachment.html>


More information about the Users mailing list