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

Kai Behncke Kai-Behncke at gmx.de
Tue Jul 28 09:03:04 EDT 2009


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
-- 
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