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

Marc Desharnais marc.desharnais at ec.gc.ca
Fri Jul 20 11:21:14 EDT 2007


Hi all,

For the record, I asked the geoserver team and it seems that no such 
options exists for now. The problem is that for now they do a getinfo on 
the coordonates of the geometry (a point in my case) instead of the 
representation (likely a circle for me). The representation is larger 
than the geometry so you get the feeling you can click anywhere in the 
cercle to get info.

By reality is really different ;)

This issue is opened in their bug base so I guess it will be fixed in 
the next versions.


Regards,


Marc





Dmitri Mizerkin wrote:
> 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 
> <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 
> <mailto: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>
>     > <
>     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>
>     > <mailto: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>
>     >     <mailto: 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>
>     <mailto: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>
>     <mailto: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/a978ee4f/attachment.html


More information about the Users mailing list