[OpenLayers-Users] Some question
to OpenLayers.Protocol.WFS.fromWMSLayer
Kai Behncke
Kai-Behncke at gmx.de
Tue Jul 28 10:03:47 EDT 2009
Hi Marc,
thank you for that hint, but unfortunately it doesn` work (well, the pixel tolerance works but then the coordinate is not fitted and it gives an "empty"-WFS result).
I will try on.
Best regards, Kai
-------- Original-Nachricht --------
> Datum: Tue, 28 Jul 2009 15:19:43 +0200
> Von: Marc Jansen <jansen at terrestris.de>
> An: Kai Behncke <Kai-Behncke at gmx.de>
> CC: users at openlayers.org
> Betreff: Re: [OpenLayers-Users] Some question to OpenLayers.Protocol.WFS.fromWMSLayer
> 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
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
More information about the Users
mailing list