Merge pull request #7635 from fredj/named_export

More module renaming
This commit is contained in:
Frédéric Junod
2017-12-19 16:41:14 +01:00
committed by GitHub
26 changed files with 137 additions and 137 deletions
+4 -4
View File
@@ -6,7 +6,7 @@ import {createFromTileUrlFunctions} from '../tileurlfunction.js';
import {applyTransform, intersects} from '../extent.js';
import _ol_net_ from '../net.js';
import {get as getProjection, getTransformFromProjections} from '../proj.js';
import _ol_source_State_ from '../source/State.js';
import SourceState from '../source/State.js';
import _ol_source_TileImage_ from '../source/TileImage.js';
import _ol_tilecoord_ from '../tilecoord.js';
import _ol_tilegrid_ from '../tilegrid.js';
@@ -34,7 +34,7 @@ var _ol_source_BingMaps_ = function(options) {
opaque: true,
projection: getProjection('EPSG:3857'),
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
state: _ol_source_State_.LOADING,
state: SourceState.LOADING,
tileLoadFunction: options.tileLoadFunction,
tilePixelRatio: this.hidpi_ ? 2 : 1,
wrapX: options.wrapX !== undefined ? options.wrapX : true,
@@ -121,7 +121,7 @@ _ol_source_BingMaps_.prototype.handleImageryMetadataResponse = function(response
response.authenticationResultCode != 'ValidCredentials' ||
response.resourceSets.length != 1 ||
response.resourceSets[0].resources.length != 1) {
this.setState(_ol_source_State_.ERROR);
this.setState(SourceState.ERROR);
return;
}
@@ -204,6 +204,6 @@ _ol_source_BingMaps_.prototype.handleImageryMetadataResponse = function(response
});
}
this.setState(_ol_source_State_.READY);
this.setState(SourceState.READY);
};
export default _ol_source_BingMaps_;
+6 -6
View File
@@ -3,7 +3,7 @@
*/
import {inherits} from '../index.js';
import _ol_obj_ from '../obj.js';
import _ol_source_State_ from '../source/State.js';
import SourceState from '../source/State.js';
import _ol_source_XYZ_ from '../source/XYZ.js';
/**
@@ -48,7 +48,7 @@ var _ol_source_CartoDB_ = function(options) {
maxZoom: options.maxZoom !== undefined ? options.maxZoom : 18,
minZoom: options.minZoom,
projection: options.projection,
state: _ol_source_State_.LOADING,
state: SourceState.LOADING,
wrapX: options.wrapX
});
this.initializeMap_();
@@ -132,14 +132,14 @@ _ol_source_CartoDB_.prototype.handleInitResponse_ = function(paramHash, event) {
try {
response = /** @type {CartoDBLayerInfo} */(JSON.parse(client.responseText));
} catch (err) {
this.setState(_ol_source_State_.ERROR);
this.setState(SourceState.ERROR);
return;
}
this.applyTemplate_(response);
this.templateCache_[paramHash] = response;
this.setState(_ol_source_State_.READY);
this.setState(SourceState.READY);
} else {
this.setState(_ol_source_State_.ERROR);
this.setState(SourceState.ERROR);
}
};
@@ -149,7 +149,7 @@ _ol_source_CartoDB_.prototype.handleInitResponse_ = function(paramHash, event) {
* @param {Event} event Event.
*/
_ol_source_CartoDB_.prototype.handleInitError_ = function(event) {
this.setState(_ol_source_State_.ERROR);
this.setState(SourceState.ERROR);
};
+3 -3
View File
@@ -9,7 +9,7 @@ import Event from '../events/Event.js';
import {equals} from '../extent.js';
import {equivalent} from '../proj.js';
import _ol_reproj_Image_ from '../reproj/Image.js';
import _ol_source_Source_ from '../source/Source.js';
import Source from '../source/Source.js';
/**
* @classdesc
@@ -24,7 +24,7 @@ import _ol_source_Source_ from '../source/Source.js';
* @api
*/
var _ol_source_Image_ = function(options) {
_ol_source_Source_.call(this, {
Source.call(this, {
attributions: options.attributions,
extent: options.extent,
projection: options.projection,
@@ -53,7 +53,7 @@ var _ol_source_Image_ = function(options) {
this.reprojectedRevision_ = 0;
};
inherits(_ol_source_Image_, _ol_source_Source_);
inherits(_ol_source_Image_, Source);
/**
+5 -5
View File
@@ -13,7 +13,7 @@ import _ol_obj_ from '../obj.js';
import {get as getProjection, transform} from '../proj.js';
import _ol_reproj_ from '../reproj.js';
import _ol_source_Image_ from '../source/Image.js';
import _ol_source_WMSServerType_ from '../source/WMSServerType.js';
import WMSServerType from '../source/WMSServerType.js';
import _ol_string_ from '../string.js';
import _ol_uri_ from '../uri.js';
@@ -275,7 +275,7 @@ _ol_source_ImageWMS_.prototype.getRequestUrl_ = function(extent, size, pixelRati
if (pixelRatio != 1) {
switch (this.serverType_) {
case _ol_source_WMSServerType_.GEOSERVER:
case WMSServerType.GEOSERVER:
var dpi = (90 * pixelRatio + 0.5) | 0;
if ('FORMAT_OPTIONS' in params) {
params['FORMAT_OPTIONS'] += ';dpi:' + dpi;
@@ -283,11 +283,11 @@ _ol_source_ImageWMS_.prototype.getRequestUrl_ = function(extent, size, pixelRati
params['FORMAT_OPTIONS'] = 'dpi:' + dpi;
}
break;
case _ol_source_WMSServerType_.MAPSERVER:
case WMSServerType.MAPSERVER:
params['MAP_RESOLUTION'] = 90 * pixelRatio;
break;
case _ol_source_WMSServerType_.CARMENTA_SERVER:
case _ol_source_WMSServerType_.QGIS:
case WMSServerType.CARMENTA_SERVER:
case WMSServerType.QGIS:
params['DPI'] = 90 * pixelRatio;
break;
default:
+5 -5
View File
@@ -16,8 +16,8 @@ import _ol_obj_ from '../obj.js';
import _ol_renderer_canvas_ImageLayer_ from '../renderer/canvas/ImageLayer.js';
import _ol_renderer_canvas_TileLayer_ from '../renderer/canvas/TileLayer.js';
import _ol_source_Image_ from '../source/Image.js';
import _ol_source_RasterOperationType_ from '../source/RasterOperationType.js';
import _ol_source_State_ from '../source/State.js';
import RasterOperationType from '../source/RasterOperationType.js';
import SourceState from '../source/State.js';
import _ol_source_Tile_ from '../source/Tile.js';
import _ol_transform_ from '../transform.js';
@@ -46,7 +46,7 @@ var _ol_source_Raster_ = function(options) {
* @type {ol.source.RasterOperationType}
*/
this.operationType_ = options.operationType !== undefined ?
options.operationType : _ol_source_RasterOperationType_.PIXEL;
options.operationType : RasterOperationType.PIXEL;
/**
* @private
@@ -149,7 +149,7 @@ inherits(_ol_source_Raster_, _ol_source_Image_);
_ol_source_Raster_.prototype.setOperation = function(operation, opt_lib) {
this.worker_ = new Processor({
operation: operation,
imageOps: this.operationType_ === _ol_source_RasterOperationType_.IMAGE,
imageOps: this.operationType_ === RasterOperationType.IMAGE,
queue: 1,
lib: opt_lib,
threads: this.threads_
@@ -201,7 +201,7 @@ _ol_source_Raster_.prototype.allSourcesReady_ = function() {
var source;
for (var i = 0, ii = this.renderers_.length; i < ii; ++i) {
source = this.renderers_[i].getLayer().getSource();
if (source.getState() !== _ol_source_State_.READY) {
if (source.getState() !== SourceState.READY) {
ready = false;
break;
}
+15 -15
View File
@@ -4,7 +4,7 @@
import {inherits, nullFunction} from '../index.js';
import _ol_Object_ from '../Object.js';
import {get as getProjection} from '../proj.js';
import _ol_source_State_ from '../source/State.js';
import SourceState from '../source/State.js';
/**
@@ -21,7 +21,7 @@ import _ol_source_State_ from '../source/State.js';
* @param {ol.SourceSourceOptions} options Source options.
* @api
*/
var _ol_source_Source_ = function(options) {
var Source = function(options) {
_ol_Object_.call(this);
@@ -42,7 +42,7 @@ var _ol_source_Source_ = function(options) {
* @type {ol.source.State}
*/
this.state_ = options.state !== undefined ?
options.state : _ol_source_State_.READY;
options.state : SourceState.READY;
/**
* @private
@@ -52,14 +52,14 @@ var _ol_source_Source_ = function(options) {
};
inherits(_ol_source_Source_, _ol_Object_);
inherits(Source, _ol_Object_);
/**
* Turns the attributions option into an attributions function.
* @param {ol.AttributionLike|undefined} attributionLike The attribution option.
* @return {?ol.Attribution} An attribution function (or null).
*/
_ol_source_Source_.prototype.adaptAttributions_ = function(attributionLike) {
Source.prototype.adaptAttributions_ = function(attributionLike) {
if (!attributionLike) {
return null;
}
@@ -89,14 +89,14 @@ _ol_source_Source_.prototype.adaptAttributions_ = function(attributionLike) {
* @return {T|undefined} Callback result.
* @template T
*/
_ol_source_Source_.prototype.forEachFeatureAtCoordinate = nullFunction;
Source.prototype.forEachFeatureAtCoordinate = nullFunction;
/**
* Get the attribution function for the source.
* @return {?ol.Attribution} Attribution function.
*/
_ol_source_Source_.prototype.getAttributions = function() {
Source.prototype.getAttributions = function() {
return this.attributions_;
};
@@ -106,7 +106,7 @@ _ol_source_Source_.prototype.getAttributions = function() {
* @return {ol.proj.Projection} Projection.
* @api
*/
_ol_source_Source_.prototype.getProjection = function() {
Source.prototype.getProjection = function() {
return this.projection_;
};
@@ -115,7 +115,7 @@ _ol_source_Source_.prototype.getProjection = function() {
* @abstract
* @return {Array.<number>|undefined} Resolutions.
*/
_ol_source_Source_.prototype.getResolutions = function() {};
Source.prototype.getResolutions = function() {};
/**
@@ -123,7 +123,7 @@ _ol_source_Source_.prototype.getResolutions = function() {};
* @return {ol.source.State} State.
* @api
*/
_ol_source_Source_.prototype.getState = function() {
Source.prototype.getState = function() {
return this.state_;
};
@@ -131,7 +131,7 @@ _ol_source_Source_.prototype.getState = function() {
/**
* @return {boolean|undefined} Wrap X.
*/
_ol_source_Source_.prototype.getWrapX = function() {
Source.prototype.getWrapX = function() {
return this.wrapX_;
};
@@ -140,7 +140,7 @@ _ol_source_Source_.prototype.getWrapX = function() {
* Refreshes the source and finally dispatches a 'change' event.
* @api
*/
_ol_source_Source_.prototype.refresh = function() {
Source.prototype.refresh = function() {
this.changed();
};
@@ -152,7 +152,7 @@ _ol_source_Source_.prototype.refresh = function() {
* or `undefined`.
* @api
*/
_ol_source_Source_.prototype.setAttributions = function(attributions) {
Source.prototype.setAttributions = function(attributions) {
this.attributions_ = this.adaptAttributions_(attributions);
this.changed();
};
@@ -163,8 +163,8 @@ _ol_source_Source_.prototype.setAttributions = function(attributions) {
* @param {ol.source.State} state State.
* @protected
*/
_ol_source_Source_.prototype.setState = function(state) {
Source.prototype.setState = function(state) {
this.state_ = state;
this.changed();
};
export default _ol_source_Source_;
export default Source;
+3 -3
View File
@@ -7,7 +7,7 @@ import _ol_TileState_ from '../TileState.js';
import Event from '../events/Event.js';
import {equivalent} from '../proj.js';
import _ol_size_ from '../size.js';
import _ol_source_Source_ from '../source/Source.js';
import Source from '../source/Source.js';
import _ol_tilecoord_ from '../tilecoord.js';
import _ol_tilegrid_ from '../tilegrid.js';
@@ -25,7 +25,7 @@ import _ol_tilegrid_ from '../tilegrid.js';
*/
var _ol_source_Tile_ = function(options) {
_ol_source_Source_.call(this, {
Source.call(this, {
attributions: options.attributions,
extent: options.extent,
projection: options.projection,
@@ -78,7 +78,7 @@ var _ol_source_Tile_ = function(options) {
};
inherits(_ol_source_Tile_, _ol_source_Source_);
inherits(_ol_source_Tile_, Source);
/**
+4 -4
View File
@@ -13,7 +13,7 @@ import {assert} from '../asserts.js';
import {applyTransform, intersects} from '../extent.js';
import _ol_net_ from '../net.js';
import {get as getProjection, getTransformFromProjections} from '../proj.js';
import _ol_source_State_ from '../source/State.js';
import SourceState from '../source/State.js';
import _ol_source_TileImage_ from '../source/TileImage.js';
import _ol_tilegrid_ from '../tilegrid.js';
@@ -40,7 +40,7 @@ var _ol_source_TileJSON_ = function(options) {
crossOrigin: options.crossOrigin,
projection: getProjection('EPSG:3857'),
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
state: _ol_source_State_.LOADING,
state: SourceState.LOADING,
tileLoadFunction: options.tileLoadFunction,
wrapX: options.wrapX !== undefined ? options.wrapX : true,
transition: options.transition
@@ -148,7 +148,7 @@ _ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) {
}
this.tileJSON_ = tileJSON;
this.setState(_ol_source_State_.READY);
this.setState(SourceState.READY);
};
@@ -157,6 +157,6 @@ _ol_source_TileJSON_.prototype.handleTileJSONResponse = function(tileJSON) {
* @protected
*/
_ol_source_TileJSON_.prototype.handleTileJSONError = function() {
this.setState(_ol_source_State_.ERROR);
this.setState(SourceState.ERROR);
};
export default _ol_source_TileJSON_;
+5 -5
View File
@@ -11,7 +11,7 @@ import EventType from '../events/EventType.js';
import {applyTransform, intersects} from '../extent.js';
import _ol_net_ from '../net.js';
import {get as getProjection, getTransformFromProjections} from '../proj.js';
import _ol_source_State_ from '../source/State.js';
import SourceState from '../source/State.js';
import _ol_source_Tile_ from '../source/Tile.js';
import _ol_tilecoord_ from '../tilecoord.js';
import _ol_tilegrid_ from '../tilegrid.js';
@@ -28,7 +28,7 @@ import _ol_tilegrid_ from '../tilegrid.js';
var _ol_source_TileUTFGrid_ = function(options) {
_ol_source_Tile_.call(this, {
projection: getProjection('EPSG:3857'),
state: _ol_source_State_.LOADING
state: SourceState.LOADING
});
/**
@@ -155,7 +155,7 @@ _ol_source_TileUTFGrid_.prototype.forDataAtCoordinateAndResolution = function(
* @protected
*/
_ol_source_TileUTFGrid_.prototype.handleTileJSONError = function() {
this.setState(_ol_source_State_.ERROR);
this.setState(SourceState.ERROR);
};
@@ -189,7 +189,7 @@ _ol_source_TileUTFGrid_.prototype.handleTileJSONResponse = function(tileJSON) {
var grids = tileJSON.grids;
if (!grids) {
this.setState(_ol_source_State_.ERROR);
this.setState(SourceState.ERROR);
return;
}
@@ -207,7 +207,7 @@ _ol_source_TileUTFGrid_.prototype.handleTileJSONResponse = function(tileJSON) {
});
}
this.setState(_ol_source_State_.READY);
this.setState(SourceState.READY);
};
+5 -5
View File
@@ -12,7 +12,7 @@ import {get as getProjection, transform, transformExtent} from '../proj.js';
import _ol_reproj_ from '../reproj.js';
import _ol_size_ from '../size.js';
import _ol_source_TileImage_ from '../source/TileImage.js';
import _ol_source_WMSServerType_ from '../source/WMSServerType.js';
import WMSServerType from '../source/WMSServerType.js';
import _ol_tilecoord_ from '../tilecoord.js';
import _ol_string_ from '../string.js';
import _ol_uri_ from '../uri.js';
@@ -209,7 +209,7 @@ _ol_source_TileWMS_.prototype.getRequestUrl_ = function(tileCoord, tileSize, til
if (pixelRatio != 1) {
switch (this.serverType_) {
case _ol_source_WMSServerType_.GEOSERVER:
case WMSServerType.GEOSERVER:
var dpi = (90 * pixelRatio + 0.5) | 0;
if ('FORMAT_OPTIONS' in params) {
params['FORMAT_OPTIONS'] += ';dpi:' + dpi;
@@ -217,11 +217,11 @@ _ol_source_TileWMS_.prototype.getRequestUrl_ = function(tileCoord, tileSize, til
params['FORMAT_OPTIONS'] = 'dpi:' + dpi;
}
break;
case _ol_source_WMSServerType_.MAPSERVER:
case WMSServerType.MAPSERVER:
params['MAP_RESOLUTION'] = 90 * pixelRatio;
break;
case _ol_source_WMSServerType_.CARMENTA_SERVER:
case _ol_source_WMSServerType_.QGIS:
case WMSServerType.CARMENTA_SERVER:
case WMSServerType.QGIS:
params['DPI'] = 90 * pixelRatio;
break;
default:
+4 -4
View File
@@ -5,7 +5,7 @@ import {getUid, inherits} from '../index.js';
import _ol_TileState_ from '../TileState.js';
import {expandUrl, createFromTemplates, nullTileUrlFunction} from '../tileurlfunction.js';
import _ol_source_Tile_ from '../source/Tile.js';
import _ol_source_TileEventType_ from '../source/TileEventType.js';
import TileEventType from '../source/TileEventType.js';
import _ol_tilecoord_ from '../tilecoord.js';
/**
@@ -122,12 +122,12 @@ _ol_source_UrlTile_.prototype.handleTileChange = function(event) {
var type;
if (tileState == _ol_TileState_.LOADING) {
this.tileLoadingKeys_[uid] = true;
type = _ol_source_TileEventType_.TILELOADSTART;
type = TileEventType.TILELOADSTART;
} else if (uid in this.tileLoadingKeys_) {
delete this.tileLoadingKeys_[uid];
type = tileState == _ol_TileState_.ERROR ? _ol_source_TileEventType_.TILELOADERROR :
type = tileState == _ol_TileState_.ERROR ? TileEventType.TILELOADERROR :
(tileState == _ol_TileState_.LOADED || tileState == _ol_TileState_.ABORT) ?
_ol_source_TileEventType_.TILELOADEND : undefined;
TileEventType.TILELOADEND : undefined;
}
if (type != undefined) {
this.dispatchEvent(new _ol_source_Tile_.Event(type, tile));
+13 -13
View File
@@ -16,9 +16,9 @@ import {xhr} from '../featureloader.js';
import {TRUE} from '../functions.js';
import _ol_loadingstrategy_ from '../loadingstrategy.js';
import _ol_obj_ from '../obj.js';
import _ol_source_Source_ from '../source/Source.js';
import _ol_source_State_ from '../source/State.js';
import _ol_source_VectorEventType_ from '../source/VectorEventType.js';
import Source from '../source/Source.js';
import SourceState from '../source/State.js';
import VectorEventType from '../source/VectorEventType.js';
import RBush from '../structs/RBush.js';
/**
@@ -37,10 +37,10 @@ var _ol_source_Vector_ = function(opt_options) {
var options = opt_options || {};
_ol_source_Source_.call(this, {
Source.call(this, {
attributions: options.attributions,
projection: undefined,
state: _ol_source_State_.READY,
state: SourceState.READY,
wrapX: options.wrapX !== undefined ? options.wrapX : true
});
@@ -149,7 +149,7 @@ var _ol_source_Vector_ = function(opt_options) {
};
inherits(_ol_source_Vector_, _ol_source_Source_);
inherits(_ol_source_Vector_, Source);
/**
@@ -192,7 +192,7 @@ _ol_source_Vector_.prototype.addFeatureInternal = function(feature) {
}
this.dispatchEvent(
new _ol_source_Vector_.Event(_ol_source_VectorEventType_.ADDFEATURE, feature));
new _ol_source_Vector_.Event(VectorEventType.ADDFEATURE, feature));
};
@@ -287,7 +287,7 @@ _ol_source_Vector_.prototype.addFeaturesInternal = function(features) {
for (i = 0, length = newFeatures.length; i < length; i++) {
this.dispatchEvent(new _ol_source_Vector_.Event(
_ol_source_VectorEventType_.ADDFEATURE, newFeatures[i]));
VectorEventType.ADDFEATURE, newFeatures[i]));
}
};
@@ -298,7 +298,7 @@ _ol_source_Vector_.prototype.addFeaturesInternal = function(features) {
*/
_ol_source_Vector_.prototype.bindFeaturesCollection_ = function(collection) {
var modifyingCollection = false;
_ol_events_.listen(this, _ol_source_VectorEventType_.ADDFEATURE,
_ol_events_.listen(this, VectorEventType.ADDFEATURE,
function(evt) {
if (!modifyingCollection) {
modifyingCollection = true;
@@ -306,7 +306,7 @@ _ol_source_Vector_.prototype.bindFeaturesCollection_ = function(collection) {
modifyingCollection = false;
}
});
_ol_events_.listen(this, _ol_source_VectorEventType_.REMOVEFEATURE,
_ol_events_.listen(this, VectorEventType.REMOVEFEATURE,
function(evt) {
if (!modifyingCollection) {
modifyingCollection = true;
@@ -368,7 +368,7 @@ _ol_source_Vector_.prototype.clear = function(opt_fast) {
this.loadedExtentsRtree_.clear();
this.nullGeometryFeatures_ = {};
var clearEvent = new _ol_source_Vector_.Event(_ol_source_VectorEventType_.CLEAR);
var clearEvent = new _ol_source_Vector_.Event(VectorEventType.CLEAR);
this.dispatchEvent(clearEvent);
this.changed();
};
@@ -719,7 +719,7 @@ _ol_source_Vector_.prototype.handleFeatureChange_ = function(event) {
}
this.changed();
this.dispatchEvent(new _ol_source_Vector_.Event(
_ol_source_VectorEventType_.CHANGEFEATURE, feature));
VectorEventType.CHANGEFEATURE, feature));
};
@@ -817,7 +817,7 @@ _ol_source_Vector_.prototype.removeFeatureInternal = function(feature) {
delete this.undefIdIndex_[featureKey];
}
this.dispatchEvent(new _ol_source_Vector_.Event(
_ol_source_VectorEventType_.REMOVEFEATURE, feature));
VectorEventType.REMOVEFEATURE, feature));
};