Rename ol.MapEventType to ol.MapEvent.Type
This commit is contained in:
@@ -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.GroupProperty` to `ol.layer.Group.Property`
|
||||||
* rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property`
|
* rename `ol.layer.HeatmapLayerProperty` to `ol.layer.Heatmap.Property`
|
||||||
* rename `ol.layer.VectorTileRenderType` to `ol.layer.VectorTile.RenderType`
|
* 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.MapProperty` to `ol.Map.Property`
|
||||||
* rename `ol.RendererType` to `ol.renderer.Type`
|
* rename `ol.RendererType` to `ol.renderer.Type`
|
||||||
* rename `ol.source.TileEvent` to `ol.source.Tile.Event`
|
* rename `ol.source.TileEvent` to `ol.source.Tile.Event`
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ goog.provide('ol.control.Control');
|
|||||||
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.MapEventType');
|
goog.require('ol.MapEvent');
|
||||||
goog.require('ol.Object');
|
goog.require('ol.Object');
|
||||||
goog.require('ol.dom');
|
goog.require('ol.dom');
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ ol.control.Control.prototype.setMap = function(map) {
|
|||||||
target.appendChild(this.element);
|
target.appendChild(this.element);
|
||||||
if (this.render !== ol.nullFunction) {
|
if (this.render !== ol.nullFunction) {
|
||||||
this.listenerKeys.push(ol.events.listen(map,
|
this.listenerKeys.push(ol.events.listen(map,
|
||||||
ol.MapEventType.POSTRENDER, this.render, this));
|
ol.MapEvent.Type.POSTRENDER, this.render, this));
|
||||||
}
|
}
|
||||||
map.render();
|
map.render();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ goog.provide('ol.control.OverviewMap');
|
|||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.Collection');
|
goog.require('ol.Collection');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.MapEventType');
|
goog.require('ol.MapEvent');
|
||||||
goog.require('ol.Object');
|
goog.require('ol.Object');
|
||||||
goog.require('ol.ObjectEventType');
|
goog.require('ol.ObjectEventType');
|
||||||
goog.require('ol.Overlay');
|
goog.require('ol.Overlay');
|
||||||
@@ -445,7 +445,7 @@ ol.control.OverviewMap.prototype.handleToggle_ = function() {
|
|||||||
if (!this.collapsed_ && !ovmap.isRendered()) {
|
if (!this.collapsed_ && !ovmap.isRendered()) {
|
||||||
ovmap.updateSize();
|
ovmap.updateSize();
|
||||||
this.resetExtent_();
|
this.resetExtent_();
|
||||||
ol.events.listenOnce(ovmap, ol.MapEventType.POSTRENDER,
|
ol.events.listenOnce(ovmap, ol.MapEvent.Type.POSTRENDER,
|
||||||
function(event) {
|
function(event) {
|
||||||
this.updateBox_();
|
this.updateBox_();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ goog.require('ol.MapBrowserEvent');
|
|||||||
goog.require('ol.MapBrowserEvent.EventType');
|
goog.require('ol.MapBrowserEvent.EventType');
|
||||||
goog.require('ol.MapBrowserEventHandler');
|
goog.require('ol.MapBrowserEventHandler');
|
||||||
goog.require('ol.MapEvent');
|
goog.require('ol.MapEvent');
|
||||||
goog.require('ol.MapEventType');
|
|
||||||
goog.require('ol.Object');
|
goog.require('ol.Object');
|
||||||
goog.require('ol.ObjectEventType');
|
goog.require('ol.ObjectEventType');
|
||||||
goog.require('ol.TileQueue');
|
goog.require('ol.TileQueue');
|
||||||
@@ -1290,13 +1289,13 @@ ol.Map.prototype.renderFrame_ = function(time) {
|
|||||||
|
|
||||||
if (idle) {
|
if (idle) {
|
||||||
this.dispatchEvent(
|
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_);
|
ol.extent.clone(frameState.extent, this.previousExtent_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dispatchEvent(
|
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);
|
setTimeout(this.handlePostRender.bind(this), 0);
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,9 @@
|
|||||||
goog.provide('ol.MapEvent');
|
goog.provide('ol.MapEvent');
|
||||||
goog.provide('ol.MapEventType');
|
|
||||||
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.events.Event');
|
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
|
* @classdesc
|
||||||
* Events emitted as map events are instances of this type.
|
* 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);
|
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'
|
||||||
|
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
goog.provide('ol.Overlay');
|
goog.provide('ol.Overlay');
|
||||||
|
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
goog.require('ol.MapEventType');
|
goog.require('ol.MapEvent');
|
||||||
goog.require('ol.Object');
|
goog.require('ol.Object');
|
||||||
goog.require('ol.animation');
|
goog.require('ol.animation');
|
||||||
goog.require('ol.dom');
|
goog.require('ol.dom');
|
||||||
@@ -237,7 +237,7 @@ ol.Overlay.prototype.handleMapChanged = function() {
|
|||||||
var map = this.getMap();
|
var map = this.getMap();
|
||||||
if (map) {
|
if (map) {
|
||||||
this.mapPostrenderListenerKey_ = ol.events.listen(map,
|
this.mapPostrenderListenerKey_ = ol.events.listen(map,
|
||||||
ol.MapEventType.POSTRENDER, this.render, this);
|
ol.MapEvent.Type.POSTRENDER, this.render, this);
|
||||||
this.updatePixelPosition();
|
this.updatePixelPosition();
|
||||||
var container = this.stopEvent_ ?
|
var container = this.stopEvent_ ?
|
||||||
map.getOverlayContainerStopEvent() : map.getOverlayContainer();
|
map.getOverlayContainerStopEvent() : map.getOverlayContainer();
|
||||||
|
|||||||
Reference in New Issue
Block a user