diff --git a/src/ol/MapBrowserEvent.js b/src/ol/MapBrowserEvent.js index 6d43d13584..412d763dbc 100644 --- a/src/ol/MapBrowserEvent.js +++ b/src/ol/MapBrowserEvent.js @@ -2,7 +2,7 @@ * @module ol/MapBrowserEvent */ import {inherits} from './index.js'; -import _ol_MapEvent_ from './MapEvent.js'; +import MapEvent from './MapEvent.js'; /** * @classdesc @@ -21,7 +21,7 @@ import _ol_MapEvent_ from './MapEvent.js'; var _ol_MapBrowserEvent_ = function(type, map, browserEvent, opt_dragging, opt_frameState) { - _ol_MapEvent_.call(this, type, map, opt_frameState); + MapEvent.call(this, type, map, opt_frameState); /** * The original browser event. @@ -56,7 +56,7 @@ var _ol_MapBrowserEvent_ = function(type, map, browserEvent, opt_dragging, }; -inherits(_ol_MapBrowserEvent_, _ol_MapEvent_); +inherits(_ol_MapBrowserEvent_, MapEvent); /** @@ -66,7 +66,7 @@ inherits(_ol_MapBrowserEvent_, _ol_MapEvent_); * @api */ _ol_MapBrowserEvent_.prototype.preventDefault = function() { - _ol_MapEvent_.prototype.preventDefault.call(this); + MapEvent.prototype.preventDefault.call(this); this.originalEvent.preventDefault(); }; @@ -78,7 +78,7 @@ _ol_MapBrowserEvent_.prototype.preventDefault = function() { * @api */ _ol_MapBrowserEvent_.prototype.stopPropagation = function() { - _ol_MapEvent_.prototype.stopPropagation.call(this); + MapEvent.prototype.stopPropagation.call(this); this.originalEvent.stopPropagation(); }; export default _ol_MapBrowserEvent_; diff --git a/src/ol/MapEvent.js b/src/ol/MapEvent.js index 8b19e6148f..5071a13078 100644 --- a/src/ol/MapEvent.js +++ b/src/ol/MapEvent.js @@ -16,7 +16,7 @@ import Event from './events/Event.js'; * @param {ol.PluggableMap} map Map. * @param {?olx.FrameState=} opt_frameState Frame state. */ -var _ol_MapEvent_ = function(type, map, opt_frameState) { +var MapEvent = function(type, map, opt_frameState) { Event.call(this, type); @@ -36,5 +36,5 @@ var _ol_MapEvent_ = function(type, map, opt_frameState) { }; -inherits(_ol_MapEvent_, Event); -export default _ol_MapEvent_; +inherits(MapEvent, Event); +export default MapEvent; diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index 20bc2d6d35..28e9a5435f 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -7,7 +7,7 @@ import _ol_CollectionEventType_ from './CollectionEventType.js'; import _ol_MapBrowserEvent_ from './MapBrowserEvent.js'; import _ol_MapBrowserEventHandler_ from './MapBrowserEventHandler.js'; import _ol_MapBrowserEventType_ from './MapBrowserEventType.js'; -import _ol_MapEvent_ from './MapEvent.js'; +import MapEvent from './MapEvent.js'; import _ol_MapEventType_ from './MapEventType.js'; import _ol_MapProperty_ from './MapProperty.js'; import _ol_Object_ from './Object.js'; @@ -1193,7 +1193,7 @@ _ol_PluggableMap_.prototype.renderFrame_ = function(time) { !equals(frameState.extent, this.previousExtent_)); if (moveStart) { this.dispatchEvent( - new _ol_MapEvent_(_ol_MapEventType_.MOVESTART, this, previousFrameState)); + new MapEvent(_ol_MapEventType_.MOVESTART, this, previousFrameState)); this.previousExtent_ = createOrUpdateEmpty(this.previousExtent_); } } @@ -1205,13 +1205,13 @@ _ol_PluggableMap_.prototype.renderFrame_ = function(time) { if (idle) { this.dispatchEvent( - new _ol_MapEvent_(_ol_MapEventType_.MOVEEND, this, frameState)); + new MapEvent(_ol_MapEventType_.MOVEEND, this, frameState)); clone(frameState.extent, this.previousExtent_); } } this.dispatchEvent( - new _ol_MapEvent_(_ol_MapEventType_.POSTRENDER, this, frameState)); + new MapEvent(_ol_MapEventType_.POSTRENDER, this, frameState)); setTimeout(this.handlePostRender.bind(this), 0); diff --git a/test/spec/ol/map.test.js b/test/spec/ol/map.test.js index 6e7e27b800..f21cf3d809 100644 --- a/test/spec/ol/map.test.js +++ b/test/spec/ol/map.test.js @@ -1,6 +1,6 @@ import _ol_Feature_ from '../../../src/ol/Feature.js'; import _ol_Map_ from '../../../src/ol/Map.js'; -import _ol_MapEvent_ from '../../../src/ol/MapEvent.js'; +import MapEvent from '../../../src/ol/MapEvent.js'; import _ol_Overlay_ from '../../../src/ol/Overlay.js'; import _ol_View_ from '../../../src/ol/View.js'; import Point from '../../../src/ol/geom/Point.js'; @@ -349,7 +349,7 @@ describe('ol.Map', function() { var spy = sinon.spy(map, 'renderFrame_'); map.render(); map.once('postrender', function(event) { - expect(event).to.be.a(_ol_MapEvent_); + expect(event).to.be.a(MapEvent); expect(typeof spy.firstCall.args[0]).to.be('number'); spy.restore(); var frameState = event.frameState; @@ -389,7 +389,7 @@ describe('ol.Map', function() { map.render(); map.once('postrender', function(event) { - expect(event).to.be.a(_ol_MapEvent_); + expect(event).to.be.a(MapEvent); var frameState = event.frameState; expect(frameState).to.be(null); done(); @@ -403,7 +403,7 @@ describe('ol.Map', function() { map.render(); map.once('postrender', function(event) { - expect(event).to.be.a(_ol_MapEvent_); + expect(event).to.be.a(MapEvent); var frameState = event.frameState; expect(frameState).to.be(null); done();