s/tilesource/source/
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
goog.provide('ol.layer.BingMaps');
|
goog.provide('ol.layer.BingMaps');
|
||||||
goog.provide('ol.tilesource.BingMaps');
|
goog.provide('ol.source.BingMaps');
|
||||||
|
|
||||||
goog.require('goog.Uri');
|
goog.require('goog.Uri');
|
||||||
goog.require('goog.events');
|
goog.require('goog.events');
|
||||||
@@ -33,7 +33,7 @@ ol.BingMapsStyle = {
|
|||||||
* @param {Object.<string, *>=} opt_values Values.
|
* @param {Object.<string, *>=} opt_values Values.
|
||||||
*/
|
*/
|
||||||
ol.layer.BingMaps = function(style, key, opt_culture, opt_values) {
|
ol.layer.BingMaps = function(style, key, opt_culture, opt_values) {
|
||||||
var tileSource = new ol.tilesource.BingMaps(style, key, opt_culture,
|
var tileSource = new ol.source.BingMaps(style, key, opt_culture,
|
||||||
function(tileSource) {
|
function(tileSource) {
|
||||||
this.dispatchEvent(goog.events.EventType.LOAD);
|
this.dispatchEvent(goog.events.EventType.LOAD);
|
||||||
}, this);
|
}, this);
|
||||||
@@ -49,10 +49,10 @@ goog.inherits(ol.layer.BingMaps, ol.layer.TileLayer);
|
|||||||
* @param {ol.BingMapsStyle} style Bing Maps style.
|
* @param {ol.BingMapsStyle} style Bing Maps style.
|
||||||
* @param {string} key Key.
|
* @param {string} key Key.
|
||||||
* @param {string=} opt_culture Culture.
|
* @param {string=} opt_culture Culture.
|
||||||
* @param {?function(ol.tilesource.BingMaps)=} opt_callback Callback.
|
* @param {?function(ol.source.BingMaps)=} opt_callback Callback.
|
||||||
* @param {*=} opt_obj Object.
|
* @param {*=} opt_obj Object.
|
||||||
*/
|
*/
|
||||||
ol.tilesource.BingMaps =
|
ol.source.BingMaps =
|
||||||
function(style, key, opt_culture, opt_callback, opt_obj) {
|
function(style, key, opt_culture, opt_callback, opt_obj) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,7 +69,7 @@ ol.tilesource.BingMaps =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {?function(ol.tilesource.BingMaps)}
|
* @type {?function(ol.source.BingMaps)}
|
||||||
*/
|
*/
|
||||||
this.callback_ = opt_callback || null;
|
this.callback_ = opt_callback || null;
|
||||||
|
|
||||||
@@ -94,13 +94,13 @@ ol.tilesource.BingMaps =
|
|||||||
this, projection, null, ol.TileUrlFunction.nullTileUrlFunction, extent);
|
this, projection, null, ol.TileUrlFunction.nullTileUrlFunction, extent);
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.tilesource.BingMaps, ol.TileSource);
|
goog.inherits(ol.source.BingMaps, ol.TileSource);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {BingMapsImageryMetadataResponse} response Response.
|
* @param {BingMapsImageryMetadataResponse} response Response.
|
||||||
*/
|
*/
|
||||||
ol.tilesource.BingMaps.prototype.handleImageryMetadataResponse =
|
ol.source.BingMaps.prototype.handleImageryMetadataResponse =
|
||||||
function(response) {
|
function(response) {
|
||||||
|
|
||||||
goog.asserts.assert(
|
goog.asserts.assert(
|
||||||
@@ -184,6 +184,6 @@ ol.tilesource.BingMaps.prototype.handleImageryMetadataResponse =
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.tilesource.BingMaps.prototype.isReady = function() {
|
ol.source.BingMaps.prototype.isReady = function() {
|
||||||
return this.ready_;
|
return this.ready_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ goog.provide('ol.source.OpenStreetMap');
|
|||||||
|
|
||||||
goog.require('ol.TileUrlFunction');
|
goog.require('ol.TileUrlFunction');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.tilesource.XYZ');
|
goog.require('ol.source.XYZ');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ goog.inherits(ol.layer.OpenStreetMap, ol.layer.TileLayer);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.tilesource.XYZ}
|
* @extends {ol.source.XYZ}
|
||||||
*/
|
*/
|
||||||
ol.source.OpenStreetMap = function() {
|
ol.source.OpenStreetMap = function() {
|
||||||
|
|
||||||
@@ -37,4 +37,4 @@ ol.source.OpenStreetMap = function() {
|
|||||||
goog.base(this, 18, tileUrlFunction, [attribution]);
|
goog.base(this, 18, tileUrlFunction, [attribution]);
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.source.OpenStreetMap, ol.tilesource.XYZ);
|
goog.inherits(ol.source.OpenStreetMap, ol.source.XYZ);
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
goog.provide('ol.layer.TileJSON');
|
goog.provide('ol.layer.TileJSON');
|
||||||
|
goog.provide('ol.source.TileJSON');
|
||||||
goog.provide('ol.tilejson');
|
goog.provide('ol.tilejson');
|
||||||
goog.provide('ol.tilesource.TileJSON');
|
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.events.EventType');
|
goog.require('goog.events.EventType');
|
||||||
@@ -45,7 +45,7 @@ goog.exportSymbol('grid', grid);
|
|||||||
*/
|
*/
|
||||||
ol.layer.TileJSON = function(url, opt_values) {
|
ol.layer.TileJSON = function(url, opt_values) {
|
||||||
goog.asserts.assert(goog.string.endsWith(url, '.jsonp'));
|
goog.asserts.assert(goog.string.endsWith(url, '.jsonp'));
|
||||||
var tileSource = new ol.tilesource.TileJSON(url, function(tileSource) {
|
var tileSource = new ol.source.TileJSON(url, function(tileSource) {
|
||||||
this.dispatchEvent(goog.events.EventType.LOAD);
|
this.dispatchEvent(goog.events.EventType.LOAD);
|
||||||
}, this);
|
}, this);
|
||||||
goog.base(this, tileSource, opt_values);
|
goog.base(this, tileSource, opt_values);
|
||||||
@@ -58,10 +58,10 @@ goog.inherits(ol.layer.TileJSON, ol.layer.TileLayer);
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.TileSource}
|
* @extends {ol.TileSource}
|
||||||
* @param {string} uri URI.
|
* @param {string} uri URI.
|
||||||
* @param {?function(ol.tilesource.TileJSON)=} opt_callback Callback.
|
* @param {?function(ol.source.TileJSON)=} opt_callback Callback.
|
||||||
* @param {*=} opt_obj Object.
|
* @param {*=} opt_obj Object.
|
||||||
*/
|
*/
|
||||||
ol.tilesource.TileJSON = function(uri, opt_callback, opt_obj) {
|
ol.source.TileJSON = function(uri, opt_callback, opt_obj) {
|
||||||
|
|
||||||
var projection = ol.Projection.getFromCode('EPSG:3857');
|
var projection = ol.Projection.getFromCode('EPSG:3857');
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ ol.tilesource.TileJSON = function(uri, opt_callback, opt_obj) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {?function(ol.tilesource.TileJSON)}
|
* @type {?function(ol.source.TileJSON)}
|
||||||
*/
|
*/
|
||||||
this.callback_ = opt_callback || null;
|
this.callback_ = opt_callback || null;
|
||||||
|
|
||||||
@@ -94,13 +94,13 @@ ol.tilesource.TileJSON = function(uri, opt_callback, opt_obj) {
|
|||||||
this.deferred_.addCallback(this.handleTileJSONResponse, this);
|
this.deferred_.addCallback(this.handleTileJSONResponse, this);
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.tilesource.TileJSON, ol.TileSource);
|
goog.inherits(ol.source.TileJSON, ol.TileSource);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
ol.tilesource.TileJSON.prototype.handleTileJSONResponse = function() {
|
ol.source.TileJSON.prototype.handleTileJSONResponse = function() {
|
||||||
|
|
||||||
var tileJSON = ol.tilejson.grids_.pop();
|
var tileJSON = ol.tilejson.grids_.pop();
|
||||||
|
|
||||||
@@ -176,6 +176,6 @@ ol.tilesource.TileJSON.prototype.handleTileJSONResponse = function() {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.tilesource.TileJSON.prototype.isReady = function() {
|
ol.source.TileJSON.prototype.isReady = function() {
|
||||||
return this.ready_;
|
return this.ready_;
|
||||||
};
|
};
|
||||||
|
|||||||
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
goog.provide('ol.layer.XYZ');
|
goog.provide('ol.layer.XYZ');
|
||||||
|
goog.provide('ol.source.XYZ');
|
||||||
goog.provide('ol.tilegrid.XYZ');
|
goog.provide('ol.tilegrid.XYZ');
|
||||||
goog.provide('ol.tilesource.XYZ');
|
|
||||||
|
|
||||||
goog.require('goog.math');
|
goog.require('goog.math');
|
||||||
goog.require('ol.Attribution');
|
goog.require('ol.Attribution');
|
||||||
@@ -76,7 +76,7 @@ ol.tilegrid.XYZ.prototype.forEachTileCoordParentTileRange =
|
|||||||
*/
|
*/
|
||||||
ol.layer.XYZ = function(
|
ol.layer.XYZ = function(
|
||||||
maxZoom, tileUrlFunction, opt_attributions, opt_crossOrigin, opt_values) {
|
maxZoom, tileUrlFunction, opt_attributions, opt_crossOrigin, opt_values) {
|
||||||
var tileSource = new ol.tilesource.XYZ(
|
var tileSource = new ol.source.XYZ(
|
||||||
maxZoom, tileUrlFunction, opt_attributions, opt_crossOrigin);
|
maxZoom, tileUrlFunction, opt_attributions, opt_crossOrigin);
|
||||||
goog.base(this, tileSource, opt_values);
|
goog.base(this, tileSource, opt_values);
|
||||||
};
|
};
|
||||||
@@ -92,7 +92,7 @@ goog.inherits(ol.layer.XYZ, ol.layer.TileLayer);
|
|||||||
* @param {Array.<ol.Attribution>=} opt_attributions Attributions.
|
* @param {Array.<ol.Attribution>=} opt_attributions Attributions.
|
||||||
* @param {string=} opt_crossOrigin Cross origin.
|
* @param {string=} opt_crossOrigin Cross origin.
|
||||||
*/
|
*/
|
||||||
ol.tilesource.XYZ =
|
ol.source.XYZ =
|
||||||
function(maxZoom, tileUrlFunction, opt_attributions, opt_crossOrigin) {
|
function(maxZoom, tileUrlFunction, opt_attributions, opt_crossOrigin) {
|
||||||
|
|
||||||
var projection = ol.Projection.getFromCode('EPSG:3857');
|
var projection = ol.Projection.getFromCode('EPSG:3857');
|
||||||
@@ -115,4 +115,4 @@ ol.tilesource.XYZ =
|
|||||||
opt_attributions, opt_crossOrigin);
|
opt_attributions, opt_crossOrigin);
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.tilesource.XYZ, ol.TileSource);
|
goog.inherits(ol.source.XYZ, ol.TileSource);
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
describe('ol.tilesource.XYZ', function() {
|
describe('ol.source.XYZ', function() {
|
||||||
|
|
||||||
describe('getTileCoordUrl', function() {
|
describe('getTileCoordUrl', function() {
|
||||||
|
|
||||||
var xyzTileSource, tileGrid;
|
var xyzTileSource, tileGrid;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
xyzTileSource = new ol.tilesource.XYZ(
|
xyzTileSource = new ol.source.XYZ(
|
||||||
6, ol.TileUrlFunction.createFromTemplate('{z}/{x}/{y}'));
|
6, ol.TileUrlFunction.createFromTemplate('{z}/{x}/{y}'));
|
||||||
tileGrid = xyzTileSource.getTileGrid();
|
tileGrid = xyzTileSource.getTileGrid();
|
||||||
});
|
});
|
||||||
@@ -124,4 +124,4 @@ describe('ol.tilesource.XYZ', function() {
|
|||||||
goog.require('ol.Coordinate');
|
goog.require('ol.Coordinate');
|
||||||
goog.require('ol.TileCoord');
|
goog.require('ol.TileCoord');
|
||||||
goog.require('ol.TileUrlFunction');
|
goog.require('ol.TileUrlFunction');
|
||||||
goog.require('ol.tilesource.XYZ');
|
goog.require('ol.source.XYZ');
|
||||||
|
|||||||
Reference in New Issue
Block a user