Rename ol.loading to ol.loadingstrategy
This commit is contained in:
@@ -597,6 +597,17 @@ ol.extent.isEmpty = function(extent) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {boolean} Is infinite.
|
||||
* @todo stability experimental
|
||||
*/
|
||||
ol.extent.isInfinite = function(extent) {
|
||||
return extent[0] == -Infinity || extent[1] == -Infinity ||
|
||||
extent[2] == Infinity || extent[3] == Infinity;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {ol.Coordinate} coordinate Coordinate.
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
@exportSymbol ol.loading.all
|
||||
@exportSymbol ol.loading.bbox
|
||||
@exportSymbol ol.loading.createTile
|
||||
3
src/ol/loadingstrategy.exports
Normal file
3
src/ol/loadingstrategy.exports
Normal file
@@ -0,0 +1,3 @@
|
||||
@exportSymbol ol.loadingstrategy.all
|
||||
@exportSymbol ol.loadingstrategy.bbox
|
||||
@exportSymbol ol.loadingstrategy.createTile
|
||||
@@ -1,4 +1,4 @@
|
||||
goog.provide('ol.loading');
|
||||
goog.provide('ol.loadingstrategy');
|
||||
|
||||
goog.require('ol.TileCoord');
|
||||
|
||||
@@ -8,7 +8,7 @@ goog.require('ol.TileCoord');
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {Array.<ol.Extent>} Extents.
|
||||
*/
|
||||
ol.loading.all = function(extent, resolution) {
|
||||
ol.loadingstrategy.all = function(extent, resolution) {
|
||||
return [[-Infinity, -Infinity, Infinity, Infinity]];
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ ol.loading.all = function(extent, resolution) {
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {Array.<ol.Extent>} Extents.
|
||||
*/
|
||||
ol.loading.bbox = function(extent, resolution) {
|
||||
ol.loadingstrategy.bbox = function(extent, resolution) {
|
||||
return [extent];
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ ol.loading.bbox = function(extent, resolution) {
|
||||
* @param {ol.tilegrid.TileGrid} tileGrid Tile grid.
|
||||
* @return {function(ol.Extent, number): Array.<ol.Extent>} Loading strategy.
|
||||
*/
|
||||
ol.loading.createTile = function(tileGrid) {
|
||||
ol.loadingstrategy.createTile = function(tileGrid) {
|
||||
return (
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
@@ -34,7 +34,7 @@ ol.source.ServerVector = function(options) {
|
||||
* @private
|
||||
* @type {function(ol.Extent, number): Array.<ol.Extent>}
|
||||
*/
|
||||
this.loadingFunction_ = options.loadingFunction;
|
||||
this.loadingStrategy_ = options.loadingStrategy;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -77,7 +77,7 @@ ol.source.ServerVector.prototype.addFeaturesInternal = function(features) {
|
||||
ol.source.ServerVector.prototype.loadFeatures =
|
||||
function(extent, resolution, projection) {
|
||||
var loadedExtents = this.loadedExtents_;
|
||||
var extentsToLoad = this.loadingFunction_(extent, resolution);
|
||||
var extentsToLoad = this.loadingStrategy_(extent, resolution);
|
||||
var i, ii;
|
||||
for (i = 0, ii = extentsToLoad.length; i < ii; ++i) {
|
||||
var extentToLoad = extentsToLoad[i];
|
||||
|
||||
Reference in New Issue
Block a user