From 107dd6a85ffe849215dfeb38a0a2a2f7b50065b3 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 7 Sep 2016 10:05:38 +0200 Subject: [PATCH 1/8] Rename ol.MapEventType to ol.MapEvent.Type --- changelog/upgrade-notes.md | 1 + src/ol/control/control.js | 4 ++-- src/ol/control/overviewmap.js | 4 ++-- src/ol/map.js | 5 ++-- src/ol/mapevent.js | 45 +++++++++++++++++------------------ src/ol/overlay.js | 4 ++-- 6 files changed, 31 insertions(+), 32 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 1d728abed9..15a50d6814 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -22,6 +22,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.layer.GroupProperty` to `ol.layer.Group.Property` * rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property` * rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType` + * rename `ol.MapEventType` to `ol.MapEvent.Type` * rename `ol.MapProperty` to `ol.Map.Property` * rename `ol.RendererType` to `ol.renderer.Type` * rename `ol.source.TileEvent` to `ol.source.Tile.Event` diff --git a/src/ol/control/control.js b/src/ol/control/control.js index 197cffb261..9e2ab37bd5 100644 --- a/src/ol/control/control.js +++ b/src/ol/control/control.js @@ -2,7 +2,7 @@ goog.provide('ol.control.Control'); goog.require('ol.events'); goog.require('ol'); -goog.require('ol.MapEventType'); +goog.require('ol.MapEvent'); goog.require('ol.Object'); goog.require('ol.dom'); @@ -118,7 +118,7 @@ ol.control.Control.prototype.setMap = function(map) { target.appendChild(this.element); if (this.render !== ol.nullFunction) { this.listenerKeys.push(ol.events.listen(map, - ol.MapEventType.POSTRENDER, this.render, this)); + ol.MapEvent.Type.POSTRENDER, this.render, this)); } map.render(); } diff --git a/src/ol/control/overviewmap.js b/src/ol/control/overviewmap.js index 38ec4d5633..cd099bf3c9 100644 --- a/src/ol/control/overviewmap.js +++ b/src/ol/control/overviewmap.js @@ -3,7 +3,7 @@ goog.provide('ol.control.OverviewMap'); goog.require('ol'); goog.require('ol.Collection'); goog.require('ol.Map'); -goog.require('ol.MapEventType'); +goog.require('ol.MapEvent'); goog.require('ol.Object'); goog.require('ol.ObjectEventType'); goog.require('ol.Overlay'); @@ -445,7 +445,7 @@ ol.control.OverviewMap.prototype.handleToggle_ = function() { if (!this.collapsed_ && !ovmap.isRendered()) { ovmap.updateSize(); this.resetExtent_(); - ol.events.listenOnce(ovmap, ol.MapEventType.POSTRENDER, + ol.events.listenOnce(ovmap, ol.MapEvent.Type.POSTRENDER, function(event) { this.updateBox_(); }, diff --git a/src/ol/map.js b/src/ol/map.js index 646542d390..92093a2e6d 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -10,7 +10,6 @@ goog.require('ol.MapBrowserEvent'); goog.require('ol.MapBrowserEvent.EventType'); goog.require('ol.MapBrowserEventHandler'); goog.require('ol.MapEvent'); -goog.require('ol.MapEventType'); goog.require('ol.Object'); goog.require('ol.ObjectEventType'); goog.require('ol.TileQueue'); @@ -1290,13 +1289,13 @@ ol.Map.prototype.renderFrame_ = function(time) { if (idle) { this.dispatchEvent( - new ol.MapEvent(ol.MapEventType.MOVEEND, this, frameState)); + new ol.MapEvent(ol.MapEvent.Type.MOVEEND, this, frameState)); ol.extent.clone(frameState.extent, this.previousExtent_); } } this.dispatchEvent( - new ol.MapEvent(ol.MapEventType.POSTRENDER, this, frameState)); + new ol.MapEvent(ol.MapEvent.Type.POSTRENDER, this, frameState)); setTimeout(this.handlePostRender.bind(this), 0); diff --git a/src/ol/mapevent.js b/src/ol/mapevent.js index f6186ced80..23be9a6727 100644 --- a/src/ol/mapevent.js +++ b/src/ol/mapevent.js @@ -1,32 +1,9 @@ goog.provide('ol.MapEvent'); -goog.provide('ol.MapEventType'); goog.require('ol'); goog.require('ol.events.Event'); -/** - * @enum {string} - */ -ol.MapEventType = { - - /** - * Triggered after a map frame is rendered. - * @event ol.MapEvent#postrender - * @api - */ - POSTRENDER: 'postrender', - - /** - * Triggered after the map is moved. - * @event ol.MapEvent#moveend - * @api stable - */ - MOVEEND: 'moveend' - -}; - - /** * @classdesc * Events emitted as map events are instances of this type. @@ -59,3 +36,25 @@ ol.MapEvent = function(type, map, opt_frameState) { }; ol.inherits(ol.MapEvent, ol.events.Event); + + +/** + * @enum {string} + */ +ol.MapEvent.Type = { + + /** + * Triggered after a map frame is rendered. + * @event ol.MapEvent#postrender + * @api + */ + POSTRENDER: 'postrender', + + /** + * Triggered after the map is moved. + * @event ol.MapEvent#moveend + * @api stable + */ + MOVEEND: 'moveend' + +}; diff --git a/src/ol/overlay.js b/src/ol/overlay.js index 93243560ee..635fae8aa5 100644 --- a/src/ol/overlay.js +++ b/src/ol/overlay.js @@ -1,7 +1,7 @@ goog.provide('ol.Overlay'); goog.require('ol'); -goog.require('ol.MapEventType'); +goog.require('ol.MapEvent'); goog.require('ol.Object'); goog.require('ol.animation'); goog.require('ol.dom'); @@ -237,7 +237,7 @@ ol.Overlay.prototype.handleMapChanged = function() { var map = this.getMap(); if (map) { this.mapPostrenderListenerKey_ = ol.events.listen(map, - ol.MapEventType.POSTRENDER, this.render, this); + ol.MapEvent.Type.POSTRENDER, this.render, this); this.updatePixelPosition(); var container = this.stopEvent_ ? map.getOverlayContainerStopEvent() : map.getOverlayContainer(); From 7ced5e68be271e3dccdc4b7743ab0c1085b6944d Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 7 Sep 2016 10:11:42 +0200 Subject: [PATCH 2/8] Rename ol.interaction.TranslateEvent to ol.interaction.Translate.Event --- changelog/upgrade-notes.md | 1 + src/ol/interaction/translate.js | 83 ++++++++++++++++----------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 15a50d6814..cc6755a304 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -19,6 +19,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.format.IGCZ` to `ol.format.IGC.Z` * rename `ol.interaction.DragAndDropEvent` to `ol.interaction.DragAndDrop.Event` * rename `ol.interaction.DragAndDropEventType` to `ol.interaction.DragAndDrop.EventType` + * rename `ol.interaction.TranslateEvent` to `ol.interaction.Translate.Event` * rename `ol.layer.GroupProperty` to `ol.layer.Group.Property` * rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property` * rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType` diff --git a/src/ol/interaction/translate.js b/src/ol/interaction/translate.js index c26c8cdc7e..9578f31252 100644 --- a/src/ol/interaction/translate.js +++ b/src/ol/interaction/translate.js @@ -1,5 +1,4 @@ goog.provide('ol.interaction.Translate'); -goog.provide('ol.interaction.TranslateEvent'); goog.require('ol'); goog.require('ol.events.Event'); @@ -14,66 +13,32 @@ goog.require('ol.interaction.Pointer'); ol.interaction.TranslateEventType = { /** * Triggered upon feature translation start. - * @event ol.interaction.TranslateEvent#translatestart + * @event ol.interaction.Translate.Event#translatestart * @api */ TRANSLATESTART: 'translatestart', /** * Triggered upon feature translation. - * @event ol.interaction.TranslateEvent#translating + * @event ol.interaction.Translate.Event#translating * @api */ TRANSLATING: 'translating', /** * Triggered upon feature translation end. - * @event ol.interaction.TranslateEvent#translateend + * @event ol.interaction.Translate.Event#translateend * @api */ TRANSLATEEND: 'translateend' }; -/** - * @classdesc - * Events emitted by {@link ol.interaction.Translate} instances are instances of - * this type. - * - * @constructor - * @extends {ol.events.Event} - * @implements {oli.interaction.TranslateEvent} - * @param {ol.interaction.TranslateEventType} type Type. - * @param {ol.Collection.} features The features translated. - * @param {ol.Coordinate} coordinate The event coordinate. - */ -ol.interaction.TranslateEvent = function(type, features, coordinate) { - - ol.events.Event.call(this, type); - - /** - * The features being translated. - * @type {ol.Collection.} - * @api - */ - this.features = features; - - /** - * The coordinate of the drag event. - * @const - * @type {ol.Coordinate} - * @api - */ - this.coordinate = coordinate; -}; -ol.inherits(ol.interaction.TranslateEvent, ol.events.Event); - - /** * @classdesc * Interaction for translating (moving) features. * * @constructor * @extends {ol.interaction.Pointer} - * @fires ol.interaction.TranslateEvent + * @fires ol.interaction.Translate.Event * @param {olx.interaction.TranslateOptions} options Options. * @api */ @@ -149,7 +114,7 @@ ol.interaction.Translate.handleDownEvent_ = function(event) { this.lastCoordinate_ = event.coordinate; ol.interaction.Translate.handleMoveEvent_.call(this, event); this.dispatchEvent( - new ol.interaction.TranslateEvent( + new ol.interaction.Translate.Event( ol.interaction.TranslateEventType.TRANSLATESTART, this.features_, event.coordinate)); return true; @@ -169,7 +134,7 @@ ol.interaction.Translate.handleUpEvent_ = function(event) { this.lastCoordinate_ = null; ol.interaction.Translate.handleMoveEvent_.call(this, event); this.dispatchEvent( - new ol.interaction.TranslateEvent( + new ol.interaction.Translate.Event( ol.interaction.TranslateEventType.TRANSLATEEND, this.features_, event.coordinate)); return true; @@ -203,7 +168,7 @@ ol.interaction.Translate.handleDragEvent_ = function(event) { this.lastCoordinate_ = newCoordinate; this.dispatchEvent( - new ol.interaction.TranslateEvent( + new ol.interaction.Translate.Event( ol.interaction.TranslateEventType.TRANSLATING, this.features_, newCoordinate)); } @@ -261,3 +226,37 @@ ol.interaction.Translate.prototype.featuresAtPixel_ = function(pixel, map) { return found; }; + + +/** + * @classdesc + * Events emitted by {@link ol.interaction.Translate} instances are instances of + * this type. + * + * @constructor + * @extends {ol.events.Event} + * @implements {oli.interaction.TranslateEvent} + * @param {ol.interaction.TranslateEventType} type Type. + * @param {ol.Collection.} features The features translated. + * @param {ol.Coordinate} coordinate The event coordinate. + */ +ol.interaction.Translate.Event = function(type, features, coordinate) { + + ol.events.Event.call(this, type); + + /** + * The features being translated. + * @type {ol.Collection.} + * @api + */ + this.features = features; + + /** + * The coordinate of the drag event. + * @const + * @type {ol.Coordinate} + * @api + */ + this.coordinate = coordinate; +}; +ol.inherits(ol.interaction.Translate.Event, ol.events.Event); From 36b50ab4911df79887231900a8691141b29e70e7 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 7 Sep 2016 10:14:11 +0200 Subject: [PATCH 3/8] Rename ol.interaction.TranslateEventType to ol.interaction.Translate.EventType --- changelog/upgrade-notes.md | 1 + src/ol/interaction/translate.js | 58 ++++++++++++++++----------------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index cc6755a304..5e8040cd1f 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -20,6 +20,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.interaction.DragAndDropEvent` to `ol.interaction.DragAndDrop.Event` * rename `ol.interaction.DragAndDropEventType` to `ol.interaction.DragAndDrop.EventType` * rename `ol.interaction.TranslateEvent` to `ol.interaction.Translate.Event` + * rename `ol.interaction.TranslateEventType` to `ol.interaction.Translate.EventType` * rename `ol.layer.GroupProperty` to `ol.layer.Group.Property` * rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property` * rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType` diff --git a/src/ol/interaction/translate.js b/src/ol/interaction/translate.js index 9578f31252..555c65432c 100644 --- a/src/ol/interaction/translate.js +++ b/src/ol/interaction/translate.js @@ -7,31 +7,6 @@ goog.require('ol.array'); goog.require('ol.interaction.Pointer'); -/** - * @enum {string} - */ -ol.interaction.TranslateEventType = { - /** - * Triggered upon feature translation start. - * @event ol.interaction.Translate.Event#translatestart - * @api - */ - TRANSLATESTART: 'translatestart', - /** - * Triggered upon feature translation. - * @event ol.interaction.Translate.Event#translating - * @api - */ - TRANSLATING: 'translating', - /** - * Triggered upon feature translation end. - * @event ol.interaction.Translate.Event#translateend - * @api - */ - TRANSLATEEND: 'translateend' -}; - - /** * @classdesc * Interaction for translating (moving) features. @@ -115,7 +90,7 @@ ol.interaction.Translate.handleDownEvent_ = function(event) { ol.interaction.Translate.handleMoveEvent_.call(this, event); this.dispatchEvent( new ol.interaction.Translate.Event( - ol.interaction.TranslateEventType.TRANSLATESTART, this.features_, + ol.interaction.Translate.EventType.TRANSLATESTART, this.features_, event.coordinate)); return true; } @@ -135,7 +110,7 @@ ol.interaction.Translate.handleUpEvent_ = function(event) { ol.interaction.Translate.handleMoveEvent_.call(this, event); this.dispatchEvent( new ol.interaction.Translate.Event( - ol.interaction.TranslateEventType.TRANSLATEEND, this.features_, + ol.interaction.Translate.EventType.TRANSLATEEND, this.features_, event.coordinate)); return true; } @@ -169,7 +144,7 @@ ol.interaction.Translate.handleDragEvent_ = function(event) { this.lastCoordinate_ = newCoordinate; this.dispatchEvent( new ol.interaction.Translate.Event( - ol.interaction.TranslateEventType.TRANSLATING, this.features_, + ol.interaction.Translate.EventType.TRANSLATING, this.features_, newCoordinate)); } }; @@ -236,7 +211,7 @@ ol.interaction.Translate.prototype.featuresAtPixel_ = function(pixel, map) { * @constructor * @extends {ol.events.Event} * @implements {oli.interaction.TranslateEvent} - * @param {ol.interaction.TranslateEventType} type Type. + * @param {ol.interaction.Translate.EventType} type Type. * @param {ol.Collection.} features The features translated. * @param {ol.Coordinate} coordinate The event coordinate. */ @@ -260,3 +235,28 @@ ol.interaction.Translate.Event = function(type, features, coordinate) { this.coordinate = coordinate; }; ol.inherits(ol.interaction.Translate.Event, ol.events.Event); + + +/** + * @enum {string} + */ +ol.interaction.Translate.EventType = { + /** + * Triggered upon feature translation start. + * @event ol.interaction.Translate.Event#translatestart + * @api + */ + TRANSLATESTART: 'translatestart', + /** + * Triggered upon feature translation. + * @event ol.interaction.Translate.Event#translating + * @api + */ + TRANSLATING: 'translating', + /** + * Triggered upon feature translation end. + * @event ol.interaction.Translate.Event#translateend + * @api + */ + TRANSLATEEND: 'translateend' +}; From d08e9e65b4ba1356151282ed2767b9a2bbdae74b Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 7 Sep 2016 10:20:23 +0200 Subject: [PATCH 4/8] Rename ol.source.ImageEvent to ol.source.Image.Event --- changelog/upgrade-notes.md | 1 + src/ol/source/image.js | 17 ++++++++--------- src/ol/source/imagearcgisrest.js | 2 +- src/ol/source/imagemapguide.js | 2 +- src/ol/source/imagewms.js | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 5e8040cd1f..e0cafd7bae 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -27,6 +27,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.MapEventType` to `ol.MapEvent.Type` * rename `ol.MapProperty` to `ol.Map.Property` * rename `ol.RendererType` to `ol.renderer.Type` + * rename `ol.source.ImageEvent` to `ol.source.Image.Event` * rename `ol.source.TileEvent` to `ol.source.Tile.Event` * rename `ol.source.TileEventType` to `ol.source.Tile.EventType` * rename `ol.source.VectorEvent` to `ol.source.Vector.Event` diff --git a/src/ol/source/image.js b/src/ol/source/image.js index 0eee7035e5..98eb2b8bba 100644 --- a/src/ol/source/image.js +++ b/src/ol/source/image.js @@ -1,5 +1,4 @@ goog.provide('ol.source.Image'); -goog.provide('ol.source.ImageEvent'); goog.require('ol'); goog.require('ol.Image'); @@ -150,17 +149,17 @@ ol.source.Image.prototype.handleImageChange = function(event) { switch (image.getState()) { case ol.Image.State.LOADING: this.dispatchEvent( - new ol.source.ImageEvent(ol.source.ImageEventType.IMAGELOADSTART, + new ol.source.Image.Event(ol.source.ImageEventType.IMAGELOADSTART, image)); break; case ol.Image.State.LOADED: this.dispatchEvent( - new ol.source.ImageEvent(ol.source.ImageEventType.IMAGELOADEND, + new ol.source.Image.Event(ol.source.ImageEventType.IMAGELOADEND, image)); break; case ol.Image.State.ERROR: this.dispatchEvent( - new ol.source.ImageEvent(ol.source.ImageEventType.IMAGELOADERROR, + new ol.source.Image.Event(ol.source.ImageEventType.IMAGELOADERROR, image)); break; default: @@ -191,7 +190,7 @@ ol.source.Image.defaultImageLoadFunction = function(image, src) { * @param {string} type Type. * @param {ol.Image} image The image. */ -ol.source.ImageEvent = function(type, image) { +ol.source.Image.Event = function(type, image) { ol.events.Event.call(this, type); @@ -203,7 +202,7 @@ ol.source.ImageEvent = function(type, image) { this.image = image; }; -ol.inherits(ol.source.ImageEvent, ol.events.Event); +ol.inherits(ol.source.Image.Event, ol.events.Event); /** @@ -213,21 +212,21 @@ ol.source.ImageEventType = { /** * Triggered when an image starts loading. - * @event ol.source.ImageEvent#imageloadstart + * @event ol.source.Image.Event#imageloadstart * @api */ IMAGELOADSTART: 'imageloadstart', /** * Triggered when an image finishes loading. - * @event ol.source.ImageEvent#imageloadend + * @event ol.source.Image.Event#imageloadend * @api */ IMAGELOADEND: 'imageloadend', /** * Triggered if image loading results in an error. - * @event ol.source.ImageEvent#imageloaderror + * @event ol.source.Image.Event#imageloaderror * @api */ IMAGELOADERROR: 'imageloaderror' diff --git a/src/ol/source/imagearcgisrest.js b/src/ol/source/imagearcgisrest.js index edf577fa22..c086788ff0 100644 --- a/src/ol/source/imagearcgisrest.js +++ b/src/ol/source/imagearcgisrest.js @@ -21,7 +21,7 @@ goog.require('ol.uri'); * {@link ol.source.TileArcGISRest} data source. * * @constructor - * @fires ol.source.ImageEvent + * @fires ol.source.Image.Event * @extends {ol.source.Image} * @param {olx.source.ImageArcGISRestOptions=} opt_options Image ArcGIS Rest Options. * @api diff --git a/src/ol/source/imagemapguide.js b/src/ol/source/imagemapguide.js index 486de8b62a..14d969526a 100644 --- a/src/ol/source/imagemapguide.js +++ b/src/ol/source/imagemapguide.js @@ -15,7 +15,7 @@ goog.require('ol.uri'); * Source for images from Mapguide servers * * @constructor - * @fires ol.source.ImageEvent + * @fires ol.source.Image.Event * @extends {ol.source.Image} * @param {olx.source.ImageMapGuideOptions} options Options. * @api stable diff --git a/src/ol/source/imagewms.js b/src/ol/source/imagewms.js index fedf3671d7..67fcfa8e3b 100644 --- a/src/ol/source/imagewms.js +++ b/src/ol/source/imagewms.js @@ -21,7 +21,7 @@ goog.require('ol.uri'); * Source for WMS servers providing single, untiled images. * * @constructor - * @fires ol.source.ImageEvent + * @fires ol.source.Image.Event * @extends {ol.source.Image} * @param {olx.source.ImageWMSOptions=} opt_options Options. * @api stable From cfc1337cde417d076dae8fc1fd72fceeb593cec0 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 7 Sep 2016 10:22:25 +0200 Subject: [PATCH 5/8] Rename ol.source.ImageEventType to ol.source.Image.EventType --- changelog/upgrade-notes.md | 1 + src/ol/source/image.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index e0cafd7bae..d70878569e 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -28,6 +28,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.MapProperty` to `ol.Map.Property` * rename `ol.RendererType` to `ol.renderer.Type` * rename `ol.source.ImageEvent` to `ol.source.Image.Event` + * rename `ol.source.ImageEventType` to `ol.source.Image.EventType` * rename `ol.source.TileEvent` to `ol.source.Tile.Event` * rename `ol.source.TileEventType` to `ol.source.Tile.EventType` * rename `ol.source.VectorEvent` to `ol.source.Vector.Event` diff --git a/src/ol/source/image.js b/src/ol/source/image.js index 98eb2b8bba..cc8477aea5 100644 --- a/src/ol/source/image.js +++ b/src/ol/source/image.js @@ -149,17 +149,17 @@ ol.source.Image.prototype.handleImageChange = function(event) { switch (image.getState()) { case ol.Image.State.LOADING: this.dispatchEvent( - new ol.source.Image.Event(ol.source.ImageEventType.IMAGELOADSTART, + new ol.source.Image.Event(ol.source.Image.EventType.IMAGELOADSTART, image)); break; case ol.Image.State.LOADED: this.dispatchEvent( - new ol.source.Image.Event(ol.source.ImageEventType.IMAGELOADEND, + new ol.source.Image.Event(ol.source.Image.EventType.IMAGELOADEND, image)); break; case ol.Image.State.ERROR: this.dispatchEvent( - new ol.source.Image.Event(ol.source.ImageEventType.IMAGELOADERROR, + new ol.source.Image.Event(ol.source.Image.EventType.IMAGELOADERROR, image)); break; default: @@ -208,7 +208,7 @@ ol.inherits(ol.source.Image.Event, ol.events.Event); /** * @enum {string} */ -ol.source.ImageEventType = { +ol.source.Image.EventType = { /** * Triggered when an image starts loading. From 151e9866eaa71fb973afe5da59a0190ca62d759a Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 7 Sep 2016 10:34:10 +0200 Subject: [PATCH 6/8] Rename ol.interaction.ExtentEvent to ol.interaction.Extent.Event --- changelog/upgrade-notes.md | 1 + src/ol/interaction/extent.js | 50 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index d70878569e..0357b9a517 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -17,6 +17,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.OverlayProperty` to `ol.Overlay.Property` * rename `ol.control.MousePositionProperty` to `ol.control.MousePosition.Property` * rename `ol.format.IGCZ` to `ol.format.IGC.Z` + * rename `ol.interaction.ExtentEvent` to `ol.interaction.Extent.Event` * rename `ol.interaction.DragAndDropEvent` to `ol.interaction.DragAndDrop.Event` * rename `ol.interaction.DragAndDropEventType` to `ol.interaction.DragAndDrop.EventType` * rename `ol.interaction.TranslateEvent` to `ol.interaction.Translate.Event` diff --git a/src/ol/interaction/extent.js b/src/ol/interaction/extent.js index ddf6f0526f..c8aec8da7e 100644 --- a/src/ol/interaction/extent.js +++ b/src/ol/interaction/extent.js @@ -1,5 +1,4 @@ goog.provide('ol.interaction.Extent'); -goog.provide('ol.interaction.ExtentEvent'); goog.provide('ol.interaction.ExtentEventType'); goog.require('ol'); @@ -24,33 +23,12 @@ goog.require('ol.style.Style'); ol.interaction.ExtentEventType = { /** * Triggered after the extent is changed - * @event ol.interaction.ExtentEvent + * @event ol.interaction.Extent.Event * @api */ EXTENTCHANGED: 'extentchanged' }; -/** - * @classdesc - * Events emitted by {@link ol.interaction.Extent} instances are instances of - * this type. - * - * @constructor - * @param {ol.Extent} extent the new extent - * @extends {ol.events.Event} - */ -ol.interaction.ExtentEvent = function(extent) { - ol.events.Event.call(this, ol.interaction.ExtentEventType.EXTENTCHANGED); - - /** - * The current extent. - * @type {ol.Extent} - * @api - */ - this.extent_ = extent; -}; - -ol.inherits(ol.interaction.ExtentEvent, ol.events.Event); /** * @classdesc @@ -60,7 +38,7 @@ ol.inherits(ol.interaction.ExtentEvent, ol.events.Event); * * @constructor * @extends {ol.interaction.Pointer} - * @fires ol.interaction.ExtentEvent + * @fires ol.interaction.Extent.Event * @param {olx.interaction.ExtentOptions=} opt_options Options. * @api */ @@ -473,5 +451,27 @@ ol.interaction.Extent.prototype.setExtent = function(extent) { //Null extent means no bbox this.extent_ = extent ? extent : null; this.createOrUpdateExtentFeature_(extent); - this.dispatchEvent(new ol.interaction.ExtentEvent(this.extent_)); + this.dispatchEvent(new ol.interaction.Extent.Event(this.extent_)); }; + + +/** + * @classdesc + * Events emitted by {@link ol.interaction.Extent} instances are instances of + * this type. + * + * @constructor + * @param {ol.Extent} extent the new extent + * @extends {ol.events.Event} + */ +ol.interaction.Extent.Event = function(extent) { + ol.events.Event.call(this, ol.interaction.ExtentEventType.EXTENTCHANGED); + + /** + * The current extent. + * @type {ol.Extent} + * @api + */ + this.extent_ = extent; +}; +ol.inherits(ol.interaction.Extent.Event, ol.events.Event); From 302f37ae7ac7e5afd3393355618e516e7f3d4406 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 7 Sep 2016 10:35:29 +0200 Subject: [PATCH 7/8] Rename ol.interaction.ExtentEventType to ol.interaction.Extent.EventType --- changelog/upgrade-notes.md | 1 + src/ol/interaction/extent.js | 29 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 0357b9a517..f026455b8a 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -18,6 +18,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.control.MousePositionProperty` to `ol.control.MousePosition.Property` * rename `ol.format.IGCZ` to `ol.format.IGC.Z` * rename `ol.interaction.ExtentEvent` to `ol.interaction.Extent.Event` + * rename `ol.interaction.ExtentEventType` to `ol.interaction.Extent.EventType` * rename `ol.interaction.DragAndDropEvent` to `ol.interaction.DragAndDrop.Event` * rename `ol.interaction.DragAndDropEventType` to `ol.interaction.DragAndDrop.EventType` * rename `ol.interaction.TranslateEvent` to `ol.interaction.Translate.Event` diff --git a/src/ol/interaction/extent.js b/src/ol/interaction/extent.js index c8aec8da7e..40b5b48b51 100644 --- a/src/ol/interaction/extent.js +++ b/src/ol/interaction/extent.js @@ -1,5 +1,4 @@ goog.provide('ol.interaction.Extent'); -goog.provide('ol.interaction.ExtentEventType'); goog.require('ol'); goog.require('ol.Feature'); @@ -17,19 +16,6 @@ goog.require('ol.source.Vector'); goog.require('ol.style.Style'); -/** - * @enum {string} - */ -ol.interaction.ExtentEventType = { - /** - * Triggered after the extent is changed - * @event ol.interaction.Extent.Event - * @api - */ - EXTENTCHANGED: 'extentchanged' -}; - - /** * @classdesc * Allows the user to draw a vector box by clicking and dragging on the map. @@ -465,7 +451,7 @@ ol.interaction.Extent.prototype.setExtent = function(extent) { * @extends {ol.events.Event} */ ol.interaction.Extent.Event = function(extent) { - ol.events.Event.call(this, ol.interaction.ExtentEventType.EXTENTCHANGED); + ol.events.Event.call(this, ol.interaction.Extent.EventType.EXTENTCHANGED); /** * The current extent. @@ -475,3 +461,16 @@ ol.interaction.Extent.Event = function(extent) { this.extent_ = extent; }; ol.inherits(ol.interaction.Extent.Event, ol.events.Event); + + +/** + * @enum {string} + */ +ol.interaction.Extent.EventType = { + /** + * Triggered after the extent is changed + * @event ol.interaction.Extent.Event + * @api + */ + EXTENTCHANGED: 'extentchanged' +}; From d35537e9758fb247cd91032a7db8673ba9a8e978 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 7 Sep 2016 10:47:39 +0200 Subject: [PATCH 8/8] Rename ol.layer.TileProperty to ol.layer.Tile.Property --- changelog/upgrade-notes.md | 1 + src/ol/layer/tile.js | 26 +++++++++++++------------- src/ol/layer/vectortile.js | 5 +++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index f026455b8a..59cf549465 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -25,6 +25,7 @@ A number of internal types have been renamed. This will not affect those who us * rename `ol.interaction.TranslateEventType` to `ol.interaction.Translate.EventType` * rename `ol.layer.GroupProperty` to `ol.layer.Group.Property` * rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property` + * rename `ol.layer.TileProperty` to `ol.layer.Tile.Property` * rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType` * rename `ol.MapEventType` to `ol.MapEvent.Type` * rename `ol.MapProperty` to `ol.Map.Property` diff --git a/src/ol/layer/tile.js b/src/ol/layer/tile.js index d445523f61..0ac7ecdbaf 100644 --- a/src/ol/layer/tile.js +++ b/src/ol/layer/tile.js @@ -5,15 +5,6 @@ goog.require('ol.layer.Layer'); goog.require('ol.obj'); -/** - * @enum {string} - */ -ol.layer.TileProperty = { - PRELOAD: 'preload', - USE_INTERIM_TILES_ON_ERROR: 'useInterimTilesOnError' -}; - - /** * @classdesc * For layer sources that provide pre-rendered, tiled images in grids that are @@ -51,7 +42,7 @@ ol.inherits(ol.layer.Tile, ol.layer.Layer); * @api */ ol.layer.Tile.prototype.getPreload = function() { - return /** @type {number} */ (this.get(ol.layer.TileProperty.PRELOAD)); + return /** @type {number} */ (this.get(ol.layer.Tile.Property.PRELOAD)); }; @@ -71,7 +62,7 @@ ol.layer.Tile.prototype.getSource; * @api */ ol.layer.Tile.prototype.setPreload = function(preload) { - this.set(ol.layer.TileProperty.PRELOAD, preload); + this.set(ol.layer.Tile.Property.PRELOAD, preload); }; @@ -83,7 +74,7 @@ ol.layer.Tile.prototype.setPreload = function(preload) { */ ol.layer.Tile.prototype.getUseInterimTilesOnError = function() { return /** @type {boolean} */ ( - this.get(ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR)); + this.get(ol.layer.Tile.Property.USE_INTERIM_TILES_ON_ERROR)); }; @@ -95,5 +86,14 @@ ol.layer.Tile.prototype.getUseInterimTilesOnError = function() { */ ol.layer.Tile.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) { this.set( - ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError); + ol.layer.Tile.Property.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError); +}; + + +/** + * @enum {string} + */ +ol.layer.Tile.Property = { + PRELOAD: 'preload', + USE_INTERIM_TILES_ON_ERROR: 'useInterimTilesOnError' }; diff --git a/src/ol/layer/vectortile.js b/src/ol/layer/vectortile.js index dc6cb383ab..8def31d2e5 100644 --- a/src/ol/layer/vectortile.js +++ b/src/ol/layer/vectortile.js @@ -2,6 +2,7 @@ goog.provide('ol.layer.VectorTile'); goog.require('ol'); goog.require('ol.asserts'); +goog.require('ol.layer.Tile'); goog.require('ol.layer.Vector'); goog.require('ol.obj'); @@ -94,7 +95,7 @@ ol.layer.VectorTile.prototype.getUseInterimTilesOnError = function() { * @api */ ol.layer.VectorTile.prototype.setPreload = function(preload) { - this.set(ol.layer.TileProperty.PRELOAD, preload); + this.set(ol.layer.Tile.Property.PRELOAD, preload); }; @@ -106,7 +107,7 @@ ol.layer.VectorTile.prototype.setPreload = function(preload) { */ ol.layer.VectorTile.prototype.setUseInterimTilesOnError = function(useInterimTilesOnError) { this.set( - ol.layer.TileProperty.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError); + ol.layer.Tile.Property.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError); };