[OpenLayers-Users] Some question to OpenLayers.Protocol.WFS.fromWMSLayer

Kai Behncke Kai-Behncke at gmx.de
Tue Jul 28 11:04:59 EDT 2009


Thank you very much, so now a


        var xyz = new OpenLayers.Control.GetFeature({
                protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layer),
                hover: true,
                clickTolerance: 50    
       });


 xyz.events.register("hoverfeature", this, function(e) {
 var my_feature = new OpenLayers.Feature.Vector(e.feature.geometry,null, style_obj1);     
      hover.addFeatures([my_feature],null,{styleMap: style_obj1});
            });


....gives me what I wanted.  :-)

Best regards, Kai


-------- Original-Nachricht --------
> Datum: Tue, 28 Jul 2009 16:45:25 +0200
> Von: Marc Jansen <jansen at terrestris.de>
> An: Andreas Hocevar <ahocevar at opengeo.org>
> CC: Kai Behncke <Kai-Behncke at gmx.de>, users at openlayers.org
> Betreff: Re: [OpenLayers-Users] Some question to	OpenLayers.Protocol.WFS.fromWMSLayer

> Hi Andreas,
> 
> 
> Andreas Hocevar schrieb:
> > Hi Kai,
> >
> > Kai Behncke wrote:
> >   
> >> 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).
> >>
> >>   
> >>     
> >>> var xyz = new OpenLayers.Control.GetFeature(
> >>>   {
> >>>     protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layer),
> >>>     hover: true,
> >>>     styleMap: style_obj1
> >>>     handlerOptions : {
> >>>       hover: {
> >>>         pixelTolerance : 10
> >>>       }
> >>>     }
> >>>   }
> >>> );
> >>>     
> >>>       
> >
> > Almost. The snippet below should work:
> >
> > var xyz = new OpenLayers.Control.GetFeature(
> >   {
> >     protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layer),
> >     hover: true,
> >     clickTolerance: 10
> >   }
> > );
> >
> >
> > Maybe the name of that property (*click*Tolerance) is misleading, but
> > that one is used for every request. 
> 
> ... yipp, that was quite misleading. Thanks for the quick doc update!
> 
> Marc
> 
> > I just fixed the docs, now at least
> > there is a hint that this is also for requests on hover.
> >
> > Also note that Control.GetFeature cannot be configured with a styleMap.
> > You have to do this on the layer.
> >
> > Regards,

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser



More information about the Users mailing list