[OpenLayers-Users] Some question
to OpenLayers.Protocol.WFS.fromWMSLayer
Marc Jansen
jansen at terrestris.de
Tue Jul 28 09:19:43 EDT 2009
Hi Kai,
a quick guess: have you tried setting the pixelTolerance-property of the
hover-handler?
var xyz = new OpenLayers.Control.GetFeature(
{
protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layer),
hover: true,
styleMap: style_obj1
handlerOptions : {
hover: {
pixelTolerance : 10
}
}
}
);
untested as usual.
Regards,
Marc
Kai Behncke schrieb:
> Dear users,
>
> I use the following code to get a highlighting if s.o. does "mouseover"
> on a wfs-point:
>
> var xyz = new OpenLayers.Control.GetFeature({
> protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layer),
> hover: true,
> styleMap: style_obj1
> });
>
> xyz.events.register("hoverfeature", this, function(e) {
> hover.addFeatures([e.feature]);
> });
> map.addControl(xyz);
> xyz.activate();
>
>
>
> ....it works well, but nevertheless I have two questions:
>
>
> 1) With that way users get rarely a result, because doing a mouseover on a single-coordinate
> off course is quite difficult (it nearly never fits the point).
>
> Is there a way to set a buffer to the WFS-points (not in the database where the coordinates are
> situated but directly in OpenLayers), so that it`s easier to get a point?
>
>
> 2) Even I declared an own style in the "var xyz"-section I still get the typical-wfs-orange-opacity style.
>
> If I write:
>
> var my_feature = new OpenLayers.Feature.Vector(e.feature.geometry,null, style_obj1);
> hover.addFeatures([my_feature]);
>
> I get what I want, but I wonder if there is a ways doing something like
>
> hover.addFeatures([e.feature],{styleMap: style_obj1}); ??? (it doesn`t work in this way).
>
>
> Thank you very much, Kai
More information about the Users
mailing list