I'm have an OpenLayer map with a single vector layer containing many features. I've been using SelectFeature to pop up some info when a feature is clicked, and that's working fine. However, I now want to add some functionality when the feature is double-clicked - specifically I just want to zoom in, and not have the popup appear.
I gave this a shot: http://blog.slashpoundbang.com/post/2342888467/openlayers-zoom-when-a-feature-in-a-vector-layer-is But it removed my single-click functionality.
Essentially this is the same problem as SelectFeature with Double-Click
Any ideas?
UPDATE:
So I'm trying a workaround using SelectFeature to handle the single click and registering an event listener on the vector layer to handle the double click. All I want to do is zoom in on the double clicked feature. This is what I have:
VEClayer.events.register('dblclick', VEClayer, function(e){
map.zoomToExtent(e.features.geometry.getBounds(), closest=true);
}
);
However now I have another problem, and I'm not sure if it's being caused by having both SelectFeature and the listener active or what. The new issue is that try as I might I can't access any of the event attributes. So when I try to get e.features.geometry.getBounds(), Firebug gives me the error "e.features is undefined". I've tried to get this multiple other ways (e.xy, e.longlat, getMousePosition) and it's always the same result.