OL3 allows you to use your own kind of events that you could use instead, and to answer your initial question, provides an easy and quick way to unregister them.
Have a look at this example: http://openlayers.org/en/v3.13.0/examples/vector-layer.html
, :
map.on('pointermove', function(evt) {
if (evt.dragging) {
return;
}
var pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel);
});
map.on('click', function(evt) {
displayFeatureInfo(evt.pixel);
});
ol.Map on, ol3. . . : http://openlayers.org/en/v3.13.0/apidoc/ol.MapBrowserEvent.html
, :
a) un, . :
var callback = function(evt) {
displayFeatureInfo(evt.pixel);
};
map.on('click', callback);
map.un('click', callback);
b) ol.Observable.unByKey, . on once, , . :
var key = map.on('click', function(evt) {
displayFeatureInfo(evt.pixel);
});
ol.Observable.unByKey(key);
b), , . , unByKey, . , .