[OpenLayers-Users] getFeatureInfo

Vincent-Gabriel Vallée vgvallee at hotmail.com
Tue Dec 11 12:51:03 EST 2007


I use this on the client side for tolerance. I use GeoServer and I don't know if it supports the tolerance and MapServer does. I used different pixel tolerance on each side of the point click to suit my own case.

            map.events.register("click",map, function (e) {
                var tolerance = { north : 3, south : 3, east : 1, west : 5}; //px
                var bounds = new OpenLayers.Bounds();
                bounds.extend(map.getLonLatFromPixel(e.xy.add(tolerance.east,tolerance.north)));
                bounds.extend(map.getLonLatFromPixel(e.xy.add(-1 * tolerance.west,-1 * tolerance.south)));
                    
                var coordinates = bounds.left + "," + bounds.bottom + " " + bounds.right + "," + bounds.top;
                    
                    //make getfeatureinfo request with coordinates as BBOX ; careful the format might not be the same as above...

                Event.stop(e);
            });




> Date: Tue, 11 Dec 2007 09:39:38 -0800
> From: bpederse at gmail.com
> To: reinhard.ortner at edu.fh-kaernten.ac.at
> CC: users at openlayers.org
> Subject: Re: [OpenLayers-Users] getFeatureInfo
> 
> hi,
> that's really a server-side change. in mapserver for example, you'd
> set TOLERANCE in your layer.
> 
> 
> On Dec 11, 2007 4:38 AM, R. Ortner
> <reinhard.ortner at edu.fh-kaernten.ac.at> wrote:
> >
> > hi,
> >
> > is there a way to expand the area of getFeatureInfo.
> > If I click on a feature in a scale of e.g. 1:1M i have to click very
> > precisely on the object to get a result (in a scale of 1:10000 it´s
> > basically ok).
> >
> >
> > --
> > View this message in context: http://www.nabble.com/getFeatureInfo-tp14273029p14273029.html
> > Sent from the OpenLayers Users mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> >
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071211/a63c483f/attachment.html


More information about the Users mailing list