Rename _ol_Object_ to BaseObject

This commit is contained in:
Tim Schaub
2018-01-08 10:03:31 -07:00
parent 35db8721b2
commit 24dd0ca924
21 changed files with 95 additions and 95 deletions

View File

@@ -4,7 +4,7 @@
import {inherits} from './index.js'; import {inherits} from './index.js';
import AssertionError from './AssertionError.js'; import AssertionError from './AssertionError.js';
import CollectionEventType from './CollectionEventType.js'; import CollectionEventType from './CollectionEventType.js';
import _ol_Object_ from './Object.js'; import BaseObject from './Object.js';
import Event from './events/Event.js'; import Event from './events/Event.js';
@@ -43,7 +43,7 @@ export var CollectionOptions;
*/ */
var _ol_Collection_ = function(opt_array, opt_options) { var _ol_Collection_ = function(opt_array, opt_options) {
_ol_Object_.call(this); BaseObject.call(this);
var options = opt_options || {}; var options = opt_options || {};
@@ -69,7 +69,7 @@ var _ol_Collection_ = function(opt_array, opt_options) {
}; };
inherits(_ol_Collection_, _ol_Object_); inherits(_ol_Collection_, BaseObject);
/** /**

View File

@@ -5,7 +5,7 @@ import {assert} from './asserts.js';
import _ol_events_ from './events.js'; import _ol_events_ from './events.js';
import EventType from './events/EventType.js'; import EventType from './events/EventType.js';
import {inherits} from './index.js'; import {inherits} from './index.js';
import _ol_Object_ from './Object.js'; import BaseObject from './Object.js';
import Geometry from './geom/Geometry.js'; import Geometry from './geom/Geometry.js';
import _ol_style_Style_ from './style/Style.js'; import _ol_style_Style_ from './style/Style.js';
@@ -56,7 +56,7 @@ import _ol_style_Style_ from './style/Style.js';
*/ */
var Feature = function(opt_geometryOrProperties) { var Feature = function(opt_geometryOrProperties) {
_ol_Object_.call(this); BaseObject.call(this);
/** /**
* @private * @private
@@ -91,7 +91,7 @@ var Feature = function(opt_geometryOrProperties) {
this.geometryChangeKey_ = null; this.geometryChangeKey_ = null;
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(this.geometryName_), this, BaseObject.getChangeEventType(this.geometryName_),
this.handleGeometryChanged_, this); this.handleGeometryChanged_, this);
if (opt_geometryOrProperties !== undefined) { if (opt_geometryOrProperties !== undefined) {
@@ -107,7 +107,7 @@ var Feature = function(opt_geometryOrProperties) {
} }
}; };
inherits(Feature, _ol_Object_); inherits(Feature, BaseObject);
/** /**
@@ -270,11 +270,11 @@ Feature.prototype.setId = function(id) {
*/ */
Feature.prototype.setGeometryName = function(name) { Feature.prototype.setGeometryName = function(name) {
_ol_events_.unlisten( _ol_events_.unlisten(
this, _ol_Object_.getChangeEventType(this.geometryName_), this, BaseObject.getChangeEventType(this.geometryName_),
this.handleGeometryChanged_, this); this.handleGeometryChanged_, this);
this.geometryName_ = name; this.geometryName_ = name;
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(this.geometryName_), this, BaseObject.getChangeEventType(this.geometryName_),
this.handleGeometryChanged_, this); this.handleGeometryChanged_, this);
this.handleGeometryChanged_(); this.handleGeometryChanged_();
}; };

View File

@@ -3,7 +3,7 @@
*/ */
import {inherits} from './index.js'; import {inherits} from './index.js';
import _ol_GeolocationProperty_ from './GeolocationProperty.js'; import _ol_GeolocationProperty_ from './GeolocationProperty.js';
import _ol_Object_ from './Object.js'; import BaseObject from './Object.js';
import _ol_events_ from './events.js'; import _ol_events_ from './events.js';
import EventType from './events/EventType.js'; import EventType from './events/EventType.js';
import {circular as circularPolygon} from './geom/Polygon.js'; import {circular as circularPolygon} from './geom/Polygon.js';
@@ -55,7 +55,7 @@ export var GeolocationOptions;
*/ */
var Geolocation = function(opt_options) { var Geolocation = function(opt_options) {
_ol_Object_.call(this); BaseObject.call(this);
var options = opt_options || {}; var options = opt_options || {};
@@ -79,10 +79,10 @@ var Geolocation = function(opt_options) {
this.watchId_ = undefined; this.watchId_ = undefined;
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(_ol_GeolocationProperty_.PROJECTION), this, BaseObject.getChangeEventType(_ol_GeolocationProperty_.PROJECTION),
this.handleProjectionChanged_, this); this.handleProjectionChanged_, this);
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(_ol_GeolocationProperty_.TRACKING), this, BaseObject.getChangeEventType(_ol_GeolocationProperty_.TRACKING),
this.handleTrackingChanged_, this); this.handleTrackingChanged_, this);
if (options.projection !== undefined) { if (options.projection !== undefined) {
@@ -96,7 +96,7 @@ var Geolocation = function(opt_options) {
}; };
inherits(Geolocation, _ol_Object_); inherits(Geolocation, BaseObject);
/** /**
@@ -104,7 +104,7 @@ inherits(Geolocation, _ol_Object_);
*/ */
Geolocation.prototype.disposeInternal = function() { Geolocation.prototype.disposeInternal = function() {
this.setTracking(false); this.setTracking(false);
_ol_Object_.prototype.disposeInternal.call(this); BaseObject.prototype.disposeInternal.call(this);
}; };

View File

@@ -52,7 +52,7 @@ import _ol_obj_ from './obj.js';
* @fires ol.Object.Event * @fires ol.Object.Event
* @api * @api
*/ */
var _ol_Object_ = function(opt_values) { var BaseObject = function(opt_values) {
Observable.call(this); Observable.call(this);
// Call ol.getUid to ensure that the order of objects' ids is the same as // Call ol.getUid to ensure that the order of objects' ids is the same as
@@ -72,24 +72,24 @@ var _ol_Object_ = function(opt_values) {
} }
}; };
inherits(_ol_Object_, Observable); inherits(BaseObject, Observable);
/** /**
* @private * @private
* @type {Object.<string, string>} * @type {Object.<string, string>}
*/ */
_ol_Object_.changeEventTypeCache_ = {}; BaseObject.changeEventTypeCache_ = {};
/** /**
* @param {string} key Key name. * @param {string} key Key name.
* @return {string} Change name. * @return {string} Change name.
*/ */
_ol_Object_.getChangeEventType = function(key) { BaseObject.getChangeEventType = function(key) {
return _ol_Object_.changeEventTypeCache_.hasOwnProperty(key) ? return BaseObject.changeEventTypeCache_.hasOwnProperty(key) ?
_ol_Object_.changeEventTypeCache_[key] : BaseObject.changeEventTypeCache_[key] :
(_ol_Object_.changeEventTypeCache_[key] = 'change:' + key); (BaseObject.changeEventTypeCache_[key] = 'change:' + key);
}; };
@@ -99,7 +99,7 @@ _ol_Object_.getChangeEventType = function(key) {
* @return {*} Value. * @return {*} Value.
* @api * @api
*/ */
_ol_Object_.prototype.get = function(key) { BaseObject.prototype.get = function(key) {
var value; var value;
if (this.values_.hasOwnProperty(key)) { if (this.values_.hasOwnProperty(key)) {
value = this.values_[key]; value = this.values_[key];
@@ -113,7 +113,7 @@ _ol_Object_.prototype.get = function(key) {
* @return {Array.<string>} List of property names. * @return {Array.<string>} List of property names.
* @api * @api
*/ */
_ol_Object_.prototype.getKeys = function() { BaseObject.prototype.getKeys = function() {
return Object.keys(this.values_); return Object.keys(this.values_);
}; };
@@ -123,7 +123,7 @@ _ol_Object_.prototype.getKeys = function() {
* @return {Object.<string, *>} Object. * @return {Object.<string, *>} Object.
* @api * @api
*/ */
_ol_Object_.prototype.getProperties = function() { BaseObject.prototype.getProperties = function() {
return _ol_obj_.assign({}, this.values_); return _ol_obj_.assign({}, this.values_);
}; };
@@ -132,12 +132,12 @@ _ol_Object_.prototype.getProperties = function() {
* @param {string} key Key name. * @param {string} key Key name.
* @param {*} oldValue Old value. * @param {*} oldValue Old value.
*/ */
_ol_Object_.prototype.notify = function(key, oldValue) { BaseObject.prototype.notify = function(key, oldValue) {
var eventType; var eventType;
eventType = _ol_Object_.getChangeEventType(key); eventType = BaseObject.getChangeEventType(key);
this.dispatchEvent(new _ol_Object_.Event(eventType, key, oldValue)); this.dispatchEvent(new BaseObject.Event(eventType, key, oldValue));
eventType = ObjectEventType.PROPERTYCHANGE; eventType = ObjectEventType.PROPERTYCHANGE;
this.dispatchEvent(new _ol_Object_.Event(eventType, key, oldValue)); this.dispatchEvent(new BaseObject.Event(eventType, key, oldValue));
}; };
@@ -148,7 +148,7 @@ _ol_Object_.prototype.notify = function(key, oldValue) {
* @param {boolean=} opt_silent Update without triggering an event. * @param {boolean=} opt_silent Update without triggering an event.
* @api * @api
*/ */
_ol_Object_.prototype.set = function(key, value, opt_silent) { BaseObject.prototype.set = function(key, value, opt_silent) {
if (opt_silent) { if (opt_silent) {
this.values_[key] = value; this.values_[key] = value;
} else { } else {
@@ -168,7 +168,7 @@ _ol_Object_.prototype.set = function(key, value, opt_silent) {
* @param {boolean=} opt_silent Update without triggering an event. * @param {boolean=} opt_silent Update without triggering an event.
* @api * @api
*/ */
_ol_Object_.prototype.setProperties = function(values, opt_silent) { BaseObject.prototype.setProperties = function(values, opt_silent) {
var key; var key;
for (key in values) { for (key in values) {
this.set(key, values[key], opt_silent); this.set(key, values[key], opt_silent);
@@ -182,7 +182,7 @@ _ol_Object_.prototype.setProperties = function(values, opt_silent) {
* @param {boolean=} opt_silent Unset without triggering an event. * @param {boolean=} opt_silent Unset without triggering an event.
* @api * @api
*/ */
_ol_Object_.prototype.unset = function(key, opt_silent) { BaseObject.prototype.unset = function(key, opt_silent) {
if (key in this.values_) { if (key in this.values_) {
var oldValue = this.values_[key]; var oldValue = this.values_[key];
delete this.values_[key]; delete this.values_[key];
@@ -204,7 +204,7 @@ _ol_Object_.prototype.unset = function(key, opt_silent) {
* @implements {oli.Object.Event} * @implements {oli.Object.Event}
* @constructor * @constructor
*/ */
_ol_Object_.Event = function(type, key, oldValue) { BaseObject.Event = function(type, key, oldValue) {
Event.call(this, type); Event.call(this, type);
/** /**
@@ -223,5 +223,5 @@ _ol_Object_.Event = function(type, key, oldValue) {
this.oldValue = oldValue; this.oldValue = oldValue;
}; };
inherits(_ol_Object_.Event, Event); inherits(BaseObject.Event, Event);
export default _ol_Object_; export default BaseObject;

View File

@@ -3,7 +3,7 @@
*/ */
import {inherits} from './index.js'; import {inherits} from './index.js';
import MapEventType from './MapEventType.js'; import MapEventType from './MapEventType.js';
import _ol_Object_ from './Object.js'; import BaseObject from './Object.js';
import OverlayPositioning from './OverlayPositioning.js'; import OverlayPositioning from './OverlayPositioning.js';
import {CLASS_SELECTABLE} from './css.js'; import {CLASS_SELECTABLE} from './css.js';
import {removeNode, removeChildren, outerWidth, outerHeight} from './dom.js'; import {removeNode, removeChildren, outerWidth, outerHeight} from './dom.js';
@@ -47,7 +47,7 @@ var Property = {
*/ */
var Overlay = function(options) { var Overlay = function(options) {
_ol_Object_.call(this); BaseObject.call(this);
/** /**
* @protected * @protected
@@ -126,23 +126,23 @@ var Overlay = function(options) {
this.mapPostrenderListenerKey = null; this.mapPostrenderListenerKey = null;
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(Property.ELEMENT), this, BaseObject.getChangeEventType(Property.ELEMENT),
this.handleElementChanged, this); this.handleElementChanged, this);
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(Property.MAP), this, BaseObject.getChangeEventType(Property.MAP),
this.handleMapChanged, this); this.handleMapChanged, this);
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(Property.OFFSET), this, BaseObject.getChangeEventType(Property.OFFSET),
this.handleOffsetChanged, this); this.handleOffsetChanged, this);
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(Property.POSITION), this, BaseObject.getChangeEventType(Property.POSITION),
this.handlePositionChanged, this); this.handlePositionChanged, this);
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(Property.POSITIONING), this, BaseObject.getChangeEventType(Property.POSITIONING),
this.handlePositioningChanged, this); this.handlePositioningChanged, this);
if (options.element !== undefined) { if (options.element !== undefined) {
@@ -161,7 +161,7 @@ var Overlay = function(options) {
}; };
inherits(Overlay, _ol_Object_); inherits(Overlay, BaseObject);
/** /**

View File

@@ -10,7 +10,7 @@ import MapBrowserEventType from './MapBrowserEventType.js';
import MapEvent from './MapEvent.js'; import MapEvent from './MapEvent.js';
import MapEventType from './MapEventType.js'; import MapEventType from './MapEventType.js';
import _ol_MapProperty_ from './MapProperty.js'; import _ol_MapProperty_ from './MapProperty.js';
import _ol_Object_ from './Object.js'; import BaseObject from './Object.js';
import ObjectEventType from './ObjectEventType.js'; import ObjectEventType from './ObjectEventType.js';
import TileQueue from './TileQueue.js'; import TileQueue from './TileQueue.js';
import View from './View.js'; import View from './View.js';
@@ -111,7 +111,7 @@ export var MapOptions;
*/ */
var PluggableMap = function(options) { var PluggableMap = function(options) {
_ol_Object_.call(this); BaseObject.call(this);
var optionsInternal = createOptionsInternal(options); var optionsInternal = createOptionsInternal(options);
@@ -337,13 +337,13 @@ var PluggableMap = function(options) {
this.skippedFeatureUids_ = {}; this.skippedFeatureUids_ = {};
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(_ol_MapProperty_.LAYERGROUP), this, BaseObject.getChangeEventType(_ol_MapProperty_.LAYERGROUP),
this.handleLayerGroupChanged_, this); this.handleLayerGroupChanged_, this);
_ol_events_.listen(this, _ol_Object_.getChangeEventType(_ol_MapProperty_.VIEW), _ol_events_.listen(this, BaseObject.getChangeEventType(_ol_MapProperty_.VIEW),
this.handleViewChanged_, this); this.handleViewChanged_, this);
_ol_events_.listen(this, _ol_Object_.getChangeEventType(_ol_MapProperty_.SIZE), _ol_events_.listen(this, BaseObject.getChangeEventType(_ol_MapProperty_.SIZE),
this.handleSizeChanged_, this); this.handleSizeChanged_, this);
_ol_events_.listen(this, _ol_Object_.getChangeEventType(_ol_MapProperty_.TARGET), _ol_events_.listen(this, BaseObject.getChangeEventType(_ol_MapProperty_.TARGET),
this.handleTargetChanged_, this); this.handleTargetChanged_, this);
// setProperties will trigger the rendering of the map if the map // setProperties will trigger the rendering of the map if the map
@@ -425,7 +425,7 @@ var PluggableMap = function(options) {
}; };
inherits(PluggableMap, _ol_Object_); inherits(PluggableMap, BaseObject);
/** /**
@@ -505,7 +505,7 @@ PluggableMap.prototype.disposeInternal = function() {
this.animationDelayKey_ = undefined; this.animationDelayKey_ = undefined;
} }
this.setTarget(null); this.setTarget(null);
_ol_Object_.prototype.disposeInternal.call(this); BaseObject.prototype.disposeInternal.call(this);
}; };

View File

@@ -4,7 +4,7 @@
import {DEFAULT_TILE_SIZE} from './tilegrid/common.js'; import {DEFAULT_TILE_SIZE} from './tilegrid/common.js';
import {inherits, getUid, nullFunction} from './index.js'; import {inherits, getUid, nullFunction} from './index.js';
import CenterConstraint from './CenterConstraint.js'; import CenterConstraint from './CenterConstraint.js';
import _ol_Object_ from './Object.js'; import BaseObject from './Object.js';
import ResolutionConstraint from './ResolutionConstraint.js'; import ResolutionConstraint from './ResolutionConstraint.js';
import RotationConstraint from './RotationConstraint.js'; import RotationConstraint from './RotationConstraint.js';
import ViewHint from './ViewHint.js'; import ViewHint from './ViewHint.js';
@@ -87,7 +87,7 @@ var DEFAULT_MIN_ZOOM = 0;
* @api * @api
*/ */
var View = function(opt_options) { var View = function(opt_options) {
_ol_Object_.call(this); BaseObject.call(this);
var options = _ol_obj_.assign({}, opt_options); var options = _ol_obj_.assign({}, opt_options);
@@ -121,7 +121,7 @@ var View = function(opt_options) {
this.applyOptions_(options); this.applyOptions_(options);
}; };
inherits(View, _ol_Object_); inherits(View, BaseObject);
/** /**

View File

@@ -3,7 +3,7 @@
*/ */
import {inherits, nullFunction} from '../index.js'; import {inherits, nullFunction} from '../index.js';
import MapEventType from '../MapEventType.js'; import MapEventType from '../MapEventType.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import {removeNode} from '../dom.js'; import {removeNode} from '../dom.js';
import _ol_events_ from '../events.js'; import _ol_events_ from '../events.js';
@@ -38,7 +38,7 @@ import _ol_events_ from '../events.js';
*/ */
var Control = function(options) { var Control = function(options) {
_ol_Object_.call(this); BaseObject.call(this);
/** /**
* @protected * @protected
@@ -75,7 +75,7 @@ var Control = function(options) {
}; };
inherits(Control, _ol_Object_); inherits(Control, BaseObject);
/** /**
@@ -83,7 +83,7 @@ inherits(Control, _ol_Object_);
*/ */
Control.prototype.disposeInternal = function() { Control.prototype.disposeInternal = function() {
removeNode(this.element); removeNode(this.element);
_ol_Object_.prototype.disposeInternal.call(this); BaseObject.prototype.disposeInternal.call(this);
}; };

View File

@@ -5,7 +5,7 @@
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_events_ from '../events.js'; import _ol_events_ from '../events.js';
import EventType from '../events/EventType.js'; import EventType from '../events/EventType.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import Control from '../control/Control.js'; import Control from '../control/Control.js';
import {getTransformFromProjections, identityTransform, get as getProjection} from '../proj.js'; import {getTransformFromProjections, identityTransform, get as getProjection} from '../proj.js';
@@ -39,7 +39,7 @@ var MousePosition = function(opt_options) {
}); });
_ol_events_.listen(this, _ol_events_.listen(this,
_ol_Object_.getChangeEventType(MousePosition.Property_.PROJECTION), BaseObject.getChangeEventType(MousePosition.Property_.PROJECTION),
this.handleProjectionChanged_, this); this.handleProjectionChanged_, this);
if (options.coordinateFormat) { if (options.coordinateFormat) {

View File

@@ -6,7 +6,7 @@ import _ol_Collection_ from '../Collection.js';
import PluggableMap from '../PluggableMap.js'; import PluggableMap from '../PluggableMap.js';
import MapEventType from '../MapEventType.js'; import MapEventType from '../MapEventType.js';
import _ol_MapProperty_ from '../MapProperty.js'; import _ol_MapProperty_ from '../MapProperty.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import ObjectEventType from '../ObjectEventType.js'; import ObjectEventType from '../ObjectEventType.js';
import Overlay from '../Overlay.js'; import Overlay from '../Overlay.js';
import OverlayPositioning from '../OverlayPositioning.js'; import OverlayPositioning from '../OverlayPositioning.js';
@@ -270,7 +270,7 @@ OverviewMap.prototype.handleMapPropertyChange_ = function(event) {
*/ */
OverviewMap.prototype.bindView_ = function(view) { OverviewMap.prototype.bindView_ = function(view) {
_ol_events_.listen(view, _ol_events_.listen(view,
_ol_Object_.getChangeEventType(ViewProperty.ROTATION), BaseObject.getChangeEventType(ViewProperty.ROTATION),
this.handleRotationChanged_, this); this.handleRotationChanged_, this);
}; };
@@ -282,7 +282,7 @@ OverviewMap.prototype.bindView_ = function(view) {
*/ */
OverviewMap.prototype.unbindView_ = function(view) { OverviewMap.prototype.unbindView_ = function(view) {
_ol_events_.unlisten(view, _ol_events_.unlisten(view,
_ol_Object_.getChangeEventType(ViewProperty.ROTATION), BaseObject.getChangeEventType(ViewProperty.ROTATION),
this.handleRotationChanged_, this); this.handleRotationChanged_, this);
}; };

View File

@@ -2,7 +2,7 @@
* @module ol/control/ScaleLine * @module ol/control/ScaleLine
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import {assert} from '../asserts.js'; import {assert} from '../asserts.js';
import Control from '../control/Control.js'; import Control from '../control/Control.js';
import ScaleLineUnits from '../control/ScaleLineUnits.js'; import ScaleLineUnits from '../control/ScaleLineUnits.js';
@@ -86,7 +86,7 @@ var ScaleLine = function(opt_options) {
}); });
_ol_events_.listen( _ol_events_.listen(
this, _ol_Object_.getChangeEventType(ScaleLine.Property_.UNITS), this, BaseObject.getChangeEventType(ScaleLine.Property_.UNITS),
this.handleUnitsChanged_, this); this.handleUnitsChanged_, this);
this.setUnits(/** @type {ol.control.ScaleLineUnits} */ (options.units) || this.setUnits(/** @type {ol.control.ScaleLineUnits} */ (options.units) ||

View File

@@ -2,7 +2,7 @@
* @module ol/geom/Geometry * @module ol/geom/Geometry
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import {createEmpty, getHeight, returnOrUpdate} from '../extent.js'; import {createEmpty, getHeight, returnOrUpdate} from '../extent.js';
import {FALSE} from '../functions.js'; import {FALSE} from '../functions.js';
import _ol_geom_flat_transform_ from '../geom/flat/transform.js'; import _ol_geom_flat_transform_ from '../geom/flat/transform.js';
@@ -26,7 +26,7 @@ import _ol_transform_ from '../transform.js';
*/ */
var Geometry = function() { var Geometry = function() {
_ol_Object_.call(this); BaseObject.call(this);
/** /**
* @private * @private
@@ -66,7 +66,7 @@ var Geometry = function() {
}; };
inherits(Geometry, _ol_Object_); inherits(Geometry, BaseObject);
/** /**

View File

@@ -4,7 +4,7 @@
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import Feature from '../Feature.js'; import Feature from '../Feature.js';
import MapBrowserEventType from '../MapBrowserEventType.js'; import MapBrowserEventType from '../MapBrowserEventType.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import _ol_coordinate_ from '../coordinate.js'; import _ol_coordinate_ from '../coordinate.js';
import _ol_events_ from '../events.js'; import _ol_events_ from '../events.js';
import Event from '../events/Event.js'; import Event from '../events/Event.js';
@@ -285,7 +285,7 @@ var Draw = function(options) {
} }
_ol_events_.listen(this, _ol_events_.listen(this,
_ol_Object_.getChangeEventType(_ol_interaction_Property_.ACTIVE), BaseObject.getChangeEventType(_ol_interaction_Property_.ACTIVE),
this.updateState_, this); this.updateState_, this);
}; };

View File

@@ -2,7 +2,7 @@
* @module ol/interaction/Interaction * @module ol/interaction/Interaction
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import {easeOut, linear} from '../easing.js'; import {easeOut, linear} from '../easing.js';
import _ol_interaction_Property_ from '../interaction/Property.js'; import _ol_interaction_Property_ from '../interaction/Property.js';
import {clamp} from '../math.js'; import {clamp} from '../math.js';
@@ -40,7 +40,7 @@ export var InteractionOptions;
*/ */
var Interaction = function(options) { var Interaction = function(options) {
_ol_Object_.call(this); BaseObject.call(this);
/** /**
* @private * @private
@@ -57,7 +57,7 @@ var Interaction = function(options) {
}; };
inherits(Interaction, _ol_Object_); inherits(Interaction, BaseObject);
/** /**

View File

@@ -3,7 +3,7 @@
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Collection_ from '../Collection.js'; import _ol_Collection_ from '../Collection.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import _ol_events_ from '../events.js'; import _ol_events_ from '../events.js';
import Event from '../events/Event.js'; import Event from '../events/Event.js';
import {TRUE} from '../functions.js'; import {TRUE} from '../functions.js';
@@ -80,7 +80,7 @@ var _ol_interaction_Translate_ = function(opt_options) {
this.lastFeature_ = null; this.lastFeature_ = null;
_ol_events_.listen(this, _ol_events_.listen(this,
_ol_Object_.getChangeEventType(_ol_interaction_Property_.ACTIVE), BaseObject.getChangeEventType(_ol_interaction_Property_.ACTIVE),
this.handleActiveChanged_, this); this.handleActiveChanged_, this);
}; };

View File

@@ -2,7 +2,7 @@
* @module ol/layer/Base * @module ol/layer/Base
*/ */
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import _ol_layer_Property_ from '../layer/Property.js'; import _ol_layer_Property_ from '../layer/Property.js';
import {clamp} from '../math.js'; import {clamp} from '../math.js';
import _ol_obj_ from '../obj.js'; import _ol_obj_ from '../obj.js';
@@ -23,7 +23,7 @@ import _ol_obj_ from '../obj.js';
*/ */
var _ol_layer_Base_ = function(options) { var _ol_layer_Base_ = function(options) {
_ol_Object_.call(this); BaseObject.call(this);
/** /**
* @type {Object.<string, *>} * @type {Object.<string, *>}
@@ -60,7 +60,7 @@ var _ol_layer_Base_ = function(options) {
}; };
inherits(_ol_layer_Base_, _ol_Object_); inherits(_ol_layer_Base_, BaseObject);
/** /**

View File

@@ -4,7 +4,7 @@
import {getUid, inherits} from '../index.js'; import {getUid, inherits} from '../index.js';
import _ol_Collection_ from '../Collection.js'; import _ol_Collection_ from '../Collection.js';
import CollectionEventType from '../CollectionEventType.js'; import CollectionEventType from '../CollectionEventType.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import ObjectEventType from '../ObjectEventType.js'; import ObjectEventType from '../ObjectEventType.js';
import {assert} from '../asserts.js'; import {assert} from '../asserts.js';
import _ol_events_ from '../events.js'; import _ol_events_ from '../events.js';
@@ -59,7 +59,7 @@ var _ol_layer_Group_ = function(opt_options) {
this.listenerKeys_ = {}; this.listenerKeys_ = {};
_ol_events_.listen(this, _ol_events_.listen(this,
_ol_Object_.getChangeEventType(Property.LAYERS), BaseObject.getChangeEventType(Property.LAYERS),
this.handleLayersChanged_, this); this.handleLayersChanged_, this);
if (layers) { if (layers) {

View File

@@ -3,7 +3,7 @@
*/ */
import _ol_events_ from '../events.js'; import _ol_events_ from '../events.js';
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import {createCanvasContext2D} from '../dom.js'; import {createCanvasContext2D} from '../dom.js';
import _ol_layer_Vector_ from '../layer/Vector.js'; import _ol_layer_Vector_ from '../layer/Vector.js';
import {clamp} from '../math.js'; import {clamp} from '../math.js';
@@ -81,7 +81,7 @@ var Heatmap = function(opt_options) {
this.styleCache_ = null; this.styleCache_ = null;
_ol_events_.listen(this, _ol_events_.listen(this,
_ol_Object_.getChangeEventType(Property.GRADIENT), BaseObject.getChangeEventType(Property.GRADIENT),
this.handleGradientChanged_, this); this.handleGradientChanged_, this);
this.setGradient(options.gradient ? options.gradient : DEFAULT_GRADIENT); this.setGradient(options.gradient ? options.gradient : DEFAULT_GRADIENT);
@@ -91,10 +91,10 @@ var Heatmap = function(opt_options) {
this.setRadius(options.radius !== undefined ? options.radius : 8); this.setRadius(options.radius !== undefined ? options.radius : 8);
_ol_events_.listen(this, _ol_events_.listen(this,
_ol_Object_.getChangeEventType(Property.BLUR), BaseObject.getChangeEventType(Property.BLUR),
this.handleStyleChanged_, this); this.handleStyleChanged_, this);
_ol_events_.listen(this, _ol_events_.listen(this,
_ol_Object_.getChangeEventType(Property.RADIUS), BaseObject.getChangeEventType(Property.RADIUS),
this.handleStyleChanged_, this); this.handleStyleChanged_, this);
this.handleStyleChanged_(); this.handleStyleChanged_();

View File

@@ -4,7 +4,7 @@
import _ol_events_ from '../events.js'; import _ol_events_ from '../events.js';
import EventType from '../events/EventType.js'; import EventType from '../events/EventType.js';
import {getUid, inherits} from '../index.js'; import {getUid, inherits} from '../index.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import _ol_layer_Base_ from '../layer/Base.js'; import _ol_layer_Base_ from '../layer/Base.js';
import _ol_layer_Property_ from '../layer/Property.js'; import _ol_layer_Property_ from '../layer/Property.js';
import _ol_obj_ from '../obj.js'; import _ol_obj_ from '../obj.js';
@@ -63,7 +63,7 @@ var _ol_layer_Layer_ = function(options) {
} }
_ol_events_.listen(this, _ol_events_.listen(this,
_ol_Object_.getChangeEventType(_ol_layer_Property_.SOURCE), BaseObject.getChangeEventType(_ol_layer_Property_.SOURCE),
this.handleSourcePropertyChange_, this); this.handleSourcePropertyChange_, this);
var source = options.source ? options.source : null; var source = options.source ? options.source : null;

View File

@@ -2,7 +2,7 @@
* @module ol/source/Source * @module ol/source/Source
*/ */
import {inherits, nullFunction} from '../index.js'; import {inherits, nullFunction} from '../index.js';
import _ol_Object_ from '../Object.js'; import BaseObject from '../Object.js';
import {get as getProjection} from '../proj.js'; import {get as getProjection} from '../proj.js';
import SourceState from '../source/State.js'; import SourceState from '../source/State.js';
@@ -23,7 +23,7 @@ import SourceState from '../source/State.js';
*/ */
var Source = function(options) { var Source = function(options) {
_ol_Object_.call(this); BaseObject.call(this);
/** /**
* @private * @private
@@ -52,7 +52,7 @@ var Source = function(options) {
}; };
inherits(Source, _ol_Object_); inherits(Source, BaseObject);
/** /**
* Turns the attributions option into an attributions function. * Turns the attributions option into an attributions function.

View File

@@ -1,4 +1,4 @@
import _ol_Object_ from '../../../src/ol/Object.js'; import BaseObject from '../../../src/ol/Object.js';
import _ol_events_ from '../../../src/ol/events.js'; import _ol_events_ from '../../../src/ol/events.js';
@@ -6,7 +6,7 @@ describe('ol.Object', function() {
var o; var o;
beforeEach(function() { beforeEach(function() {
o = new _ol_Object_(); o = new BaseObject();
}); });
describe('get, set and unset', function() { describe('get, set and unset', function() {
@@ -49,7 +49,7 @@ describe('ol.Object', function() {
describe('#get()', function() { describe('#get()', function() {
it('does not return values that are not explicitly set', function() { it('does not return values that are not explicitly set', function() {
var o = new _ol_Object_(); var o = new BaseObject();
expect(o.get('constructor')).to.be(undefined); expect(o.get('constructor')).to.be(undefined);
expect(o.get('hasOwnProperty')).to.be(undefined); expect(o.get('hasOwnProperty')).to.be(undefined);
expect(o.get('isPrototypeOf')).to.be(undefined); expect(o.get('isPrototypeOf')).to.be(undefined);
@@ -63,7 +63,7 @@ describe('ol.Object', function() {
describe('#set()', function() { describe('#set()', function() {
it('can be used with arbitrary names', function() { it('can be used with arbitrary names', function() {
var o = new _ol_Object_(); var o = new BaseObject();
o.set('set', 'sat'); o.set('set', 'sat');
expect(o.get('set')).to.be('sat'); expect(o.get('set')).to.be('sat');
@@ -80,7 +80,7 @@ describe('ol.Object', function() {
describe('#getKeys()', function() { describe('#getKeys()', function() {
it('returns property names set at construction', function() { it('returns property names set at construction', function() {
var o = new _ol_Object_({ var o = new BaseObject({
prop1: 'val1', prop1: 'val1',
prop2: 'val2', prop2: 'val2',
toString: 'string', toString: 'string',
@@ -212,7 +212,7 @@ describe('ol.Object', function() {
describe('create with options', function() { describe('create with options', function() {
it('sets the property', function() { it('sets the property', function() {
var o = new _ol_Object_({k: 1}); var o = new BaseObject({k: 1});
expect(o.get('k')).to.eql(1); expect(o.get('k')).to.eql(1);
expect(o.getKeys()).to.eql(['k']); expect(o.getKeys()).to.eql(['k']);