Rename ol.MapProperty to ol.Map.Property

This commit is contained in:
Frederic Junod
2016-09-07 09:13:41 +02:00
parent ac26a2cfcd
commit 6c7b395024
3 changed files with 27 additions and 29 deletions
+1
View File
@@ -20,6 +20,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.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`
* rename `ol.source.TileEventType` to `ol.source.Tile.EventType` * rename `ol.source.TileEventType` to `ol.source.Tile.EventType`
+1 -2
View File
@@ -4,7 +4,6 @@ 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.MapEventType');
goog.require('ol.MapProperty');
goog.require('ol.Object'); goog.require('ol.Object');
goog.require('ol.ObjectEventType'); goog.require('ol.ObjectEventType');
goog.require('ol.Overlay'); goog.require('ol.Overlay');
@@ -193,7 +192,7 @@ ol.control.OverviewMap.prototype.setMap = function(map) {
* @private * @private
*/ */
ol.control.OverviewMap.prototype.handleMapPropertyChange_ = function(event) { ol.control.OverviewMap.prototype.handleMapPropertyChange_ = function(event) {
if (event.key === ol.MapProperty.VIEW) { if (event.key === ol.Map.Property.VIEW) {
var oldView = /** @type {ol.View} */ (event.oldValue); var oldView = /** @type {ol.View} */ (event.oldValue);
if (oldView) { if (oldView) {
this.unbindView_(oldView); this.unbindView_(oldView);
+25 -27
View File
@@ -3,7 +3,6 @@
// FIXME add tilt and height? // FIXME add tilt and height?
goog.provide('ol.Map'); goog.provide('ol.Map');
goog.provide('ol.MapProperty');
goog.require('ol'); goog.require('ol');
goog.require('ol.Collection'); goog.require('ol.Collection');
@@ -84,17 +83,6 @@ ol.DEFAULT_RENDERER_TYPES = [
]; ];
/**
* @enum {string}
*/
ol.MapProperty = {
LAYERGROUP: 'layergroup',
SIZE: 'size',
TARGET: 'target',
VIEW: 'view'
};
/** /**
* @classdesc * @classdesc
* The map is the core component of OpenLayers. For a map to render, a view, * The map is the core component of OpenLayers. For a map to render, a view,
@@ -377,13 +365,13 @@ ol.Map = function(options) {
this.skippedFeatureUids_ = {}; this.skippedFeatureUids_ = {};
ol.events.listen( ol.events.listen(
this, ol.Object.getChangeEventType(ol.MapProperty.LAYERGROUP), this, ol.Object.getChangeEventType(ol.Map.Property.LAYERGROUP),
this.handleLayerGroupChanged_, this); this.handleLayerGroupChanged_, this);
ol.events.listen(this, ol.Object.getChangeEventType(ol.MapProperty.VIEW), ol.events.listen(this, ol.Object.getChangeEventType(ol.Map.Property.VIEW),
this.handleViewChanged_, this); this.handleViewChanged_, this);
ol.events.listen(this, ol.Object.getChangeEventType(ol.MapProperty.SIZE), ol.events.listen(this, ol.Object.getChangeEventType(ol.Map.Property.SIZE),
this.handleSizeChanged_, this); this.handleSizeChanged_, this);
ol.events.listen(this, ol.Object.getChangeEventType(ol.MapProperty.TARGET), ol.events.listen(this, ol.Object.getChangeEventType(ol.Map.Property.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
@@ -714,7 +702,7 @@ ol.Map.prototype.getEventPixel = function(event) {
*/ */
ol.Map.prototype.getTarget = function() { ol.Map.prototype.getTarget = function() {
return /** @type {Element|string|undefined} */ ( return /** @type {Element|string|undefined} */ (
this.get(ol.MapProperty.TARGET)); this.get(ol.Map.Property.TARGET));
}; };
@@ -810,7 +798,7 @@ ol.Map.prototype.getInteractions = function() {
* @api stable * @api stable
*/ */
ol.Map.prototype.getLayerGroup = function() { ol.Map.prototype.getLayerGroup = function() {
return /** @type {ol.layer.Group} */ (this.get(ol.MapProperty.LAYERGROUP)); return /** @type {ol.layer.Group} */ (this.get(ol.Map.Property.LAYERGROUP));
}; };
@@ -859,7 +847,7 @@ ol.Map.prototype.getRenderer = function() {
* @api stable * @api stable
*/ */
ol.Map.prototype.getSize = function() { ol.Map.prototype.getSize = function() {
return /** @type {ol.Size|undefined} */ (this.get(ol.MapProperty.SIZE)); return /** @type {ol.Size|undefined} */ (this.get(ol.Map.Property.SIZE));
}; };
@@ -871,7 +859,7 @@ ol.Map.prototype.getSize = function() {
* @api stable * @api stable
*/ */
ol.Map.prototype.getView = function() { ol.Map.prototype.getView = function() {
return /** @type {ol.View} */ (this.get(ol.MapProperty.VIEW)); return /** @type {ol.View} */ (this.get(ol.Map.Property.VIEW));
}; };
@@ -1323,7 +1311,7 @@ ol.Map.prototype.renderFrame_ = function(time) {
* @api stable * @api stable
*/ */
ol.Map.prototype.setLayerGroup = function(layerGroup) { ol.Map.prototype.setLayerGroup = function(layerGroup) {
this.set(ol.MapProperty.LAYERGROUP, layerGroup); this.set(ol.Map.Property.LAYERGROUP, layerGroup);
}; };
@@ -1334,7 +1322,7 @@ ol.Map.prototype.setLayerGroup = function(layerGroup) {
* @api * @api
*/ */
ol.Map.prototype.setSize = function(size) { ol.Map.prototype.setSize = function(size) {
this.set(ol.MapProperty.SIZE, size); this.set(ol.Map.Property.SIZE, size);
}; };
@@ -1346,7 +1334,7 @@ ol.Map.prototype.setSize = function(size) {
* @api stable * @api stable
*/ */
ol.Map.prototype.setTarget = function(target) { ol.Map.prototype.setTarget = function(target) {
this.set(ol.MapProperty.TARGET, target); this.set(ol.Map.Property.TARGET, target);
}; };
@@ -1357,7 +1345,7 @@ ol.Map.prototype.setTarget = function(target) {
* @api stable * @api stable
*/ */
ol.Map.prototype.setView = function(view) { ol.Map.prototype.setView = function(view) {
this.set(ol.MapProperty.VIEW, view); this.set(ol.Map.Property.VIEW, view);
}; };
@@ -1449,11 +1437,11 @@ ol.Map.createOptionsInternal = function(options) {
var layerGroup = (options.layers instanceof ol.layer.Group) ? var layerGroup = (options.layers instanceof ol.layer.Group) ?
options.layers : new ol.layer.Group({layers: options.layers}); options.layers : new ol.layer.Group({layers: options.layers});
values[ol.MapProperty.LAYERGROUP] = layerGroup; values[ol.Map.Property.LAYERGROUP] = layerGroup;
values[ol.MapProperty.TARGET] = options.target; values[ol.Map.Property.TARGET] = options.target;
values[ol.MapProperty.VIEW] = options.view !== undefined ? values[ol.Map.Property.VIEW] = options.view !== undefined ?
options.view : new ol.View(); options.view : new ol.View();
/** /**
@@ -1549,5 +1537,15 @@ ol.Map.createOptionsInternal = function(options) {
}; };
/**
* @enum {string}
*/
ol.Map.Property = {
LAYERGROUP: 'layergroup',
SIZE: 'size',
TARGET: 'target',
VIEW: 'view'
};
ol.proj.common.add(); ol.proj.common.add();