关于openlayers:ol事件类型
本文次要学习openlayers的Event模块相干源码BaseEventOpenlayers依据W3C DOM Level 2 Event接口简化实现了本人的事件类,它只提供了type和target属性以及preventDefault和stopPropagation办法。 class BaseEvent { /** * @param {string} type Type. */ constructor(type) { /** * @type {boolean} */ this.propagationStopped; /** * @type {boolean} */ this.defaultPrevented; /** * The event type. * @type {string} * @api */ this.type = type; /** * The event target. * @type {Object} * @api */ this.target = null; } /** * Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events * will be fired. * @api */ preventDefault() { this.defaultPrevented = true; } /** * Stop event propagation. * @api */ stopPropagation() { this.propagationStopped = true; }}EventTypeEventType对象保留了所有触发地图事件的事件名称。 ...