[OpenLayers-Users] Hard to click on points for GetFeatureInfo

Dmitri Mizerkin eisberg at gmail.com
Fri Jul 20 08:58:37 EDT 2007


Mi Marc,

so you have to request feature from the server, not feature info.

A click event on a map returns the values for x and y in the view port. You
should make a box of those adding and substracting a custom tolerance value.
After you've done so you got 4 values: minx = x - tolerance, miny = y -
tolerance, maxx = x + tolerance, maxy = y + tolerance. These can be
converted to latitude-longitude values using OpenLayers (
map.getLonLatFromViewPortPx function). After all of these actions you get
your BBOX so you can send a request to the geoserver like this:
http://your_host/geoserver/wfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=1.0.0&TYPENAME=your_layer_names&BBOX=your_bbox&MAXFEATURES=10

That's the only workaround I know.

Cheers,
Dmitri

2007/7/20, Marc Desharnais <marc.desharnais at ec.gc.ca>:
>
> Hi all,
>
> I'm using geoserver so I guess your solution won't work. Anyone has an
> idea about setting a tolerance level in geoserver?
> Or anything that would make it easier to click on a point of a map with
> geoserver.
>
>
> Thanks,
>
> Marc
>
>
> Dmitri Mizerkin wrote:
> > Hi Bill,
> >
> > that's the right way to do it. What I meant is setting the tolerance
> > via URL, in your case it would be sth like
> >
> http://youhost/...&map_layer_0_tolerance=1&map_layer_0_toleranceunits=feet
> > <
> http://youhost/...&map_layer_0_tolerance=1&map_layer_0_toleranceunits=feet
> >
> > (I don't know if the underscores in your layer name won't affect the
> > functionality so I'm assuming that it is the first layer in the
> > mapfile and using the index of it). More information can be found on
> > http://mapserver.gis.umn.edu/docs/reference/cgi/controls in the very
> > last chapter "Changing map file parameters via a form or a URL ".
> >
> > Hopefully it helps Marc with his issue.
> >
> > Regards,
> > Dmitri
> >
> > 2007/7/20, Bill Woodall <bwoodall at bwoodall.org
> > <mailto:bwoodall at bwoodall.org>>:
> >
> >     Hi All
> >
> >     What has worked for me in using TOLERANCE is to put it into the
> >     mapfile
> >     ( if you are using MapServer) like ;
> >
> >         LAYER
> >             NAME Scrub_and_Chaparral
> >             TEMPLATE blank
> >             TOLERANCE 1
> >             TOLERANCEUNITS feet
> >             METADATA
> >                 "wms_title" "Scrub_and_Chaparral"
> >                 "wms_include_items"  "CATEGORY,LEGEND,SOURCE"
> >             END
> >             TYPE POLYGON
> >             STATUS ON
> >             DATA Scrub_and_Chaparral
> >
> >     ......Bill,
> >
> >     On Thu, 2007-07-19 at 20:08 +0200, Dmitri Mizerkin wrote:
> >     > Hi Marc,
> >     >
> >     > in a WMS/WFS service request the attribute you are looking for is
> >     > called TOLERANCE. I think this should do it when set as a
> >     parameter in
> >     > getFullRequestString function (see user recipies:
> >     > http://trac.openlayers.org/wiki/GetFeatureInfo).
> >     >
> >     > Hopefully it helps you out.
> >     >
> >     > Cheers,
> >     > Dmitri
> >     >
> >     > 2007/7/19, Marc Desharnais < marc.desharnais at ec.gc.ca
> >     <mailto:marc.desharnais at ec.gc.ca>>:
> >     >         Hi all,
> >     >
> >     >         I search for an attribute to set to make it easier to
> >     click on
> >     >         points to
> >     >         get some info about them.
> >     >         I tried some things like RADIUS or REDIUS (saw that on a
> >     page
> >     >         on
> >     >         internet) but nothing works.
> >     >
> >     >         I just want it to be easier to click on the point if it's
> >     >         possible, a
> >     >         couple of pixels more.
> >     >
> >     >
> >     >         Thank in advance,
> >     >
> >     >         Marc
> >     >         _______________________________________________
> >     >         Users mailing list
> >     >         Users at openlayers.org <mailto:Users at openlayers.org>
> >     >         http://openlayers.org/mailman/listinfo/users
> >     > _______________________________________________
> >     > Users mailing list
> >     > Users at openlayers.org <mailto: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/20070720/3abf4a1a/attachment.html


More information about the Users mailing list