Код: Выделить всё
OpenLayers.Control.ClickFeature = OpenLayers.Class(OpenLayers.Control, {
defaultHandlerOptions: {
'single': true,
'double': true,
'pixelTolerance': 0,
'stopSingle': true,
'stopDouble': false
},
initialize: function(options) {
this.handlerOptions = OpenLayers.Util.extend(
{}, this.defaultHandlerOptions
);
OpenLayers.Control.prototype.initialize.apply(
this, arguments
);
this.handler = new OpenLayers.Handler.Feature(
this, layer1, {
dblclick: function(feature){
.....
}
}, this.handlerOptions
);
}
});
Код: Выделить всё
var featureClickControl = new OpenLayers.Control.ClickFeature();