[OpenLayers-Users] Vector layer with map.events.register("click")

gingerbbm stuart.jones at jacobs.com
Tue Jun 8 07:08:56 EDT 2010


OK. I needed two SelectFeature objects attached to the same layer - one to
handle mouseover events, the other to handle clicks. In the latter I assign
to featurehighlighted the function I originally wanted to call in
map.events.register("click", ...). 

Here's a snippet, for what it's worth:

    var overCtrl = new OpenLayers.Control.SelectFeature(sw_vector, {
        hover: true,
        highlightOnly: true,
        renderIntent: "transparent",
        eventListeners: {
           beforefeaturehighlighted: showTooltip,
           featurehighlighted: showTooltip,
           featureunhighlighted: showTooltip
        }
    });

    var clickCtrl = new OpenLayers.Control.SelectFeature(sw_vector, {
      renderIntent: "transparent",
      eventListeners: {
         featurehighlighted: fireWfsRequest
      }
    });

S
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Vector-layer-with-map-events-register-click-tp5149829p5153191.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list