Use goog.net.Jsonp instead of goog.net.jsloader
This commit is contained in:
@@ -9,7 +9,7 @@ goog.provide('ol.source.TileJSON');
|
|||||||
goog.provide('ol.tilejson');
|
goog.provide('ol.tilejson');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.net.jsloader');
|
goog.require('goog.net.Jsonp');
|
||||||
goog.require('ol.Attribution');
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.TileRange');
|
goog.require('ol.TileRange');
|
||||||
goog.require('ol.TileUrlFunction');
|
goog.require('ol.TileUrlFunction');
|
||||||
@@ -20,22 +20,6 @@ goog.require('ol.source.TileImage');
|
|||||||
goog.require('ol.tilegrid.XYZ');
|
goog.require('ol.tilegrid.XYZ');
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
* @type {Array.<TileJSON>}
|
|
||||||
*/
|
|
||||||
ol.tilejson.grids_ = [];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {TileJSON} tileJSON Tile JSON.
|
|
||||||
*/
|
|
||||||
var grid = function(tileJSON) {
|
|
||||||
ol.tilejson.grids_.push(tileJSON);
|
|
||||||
};
|
|
||||||
goog.exportSymbol('grid', grid);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
@@ -52,12 +36,8 @@ ol.source.TileJSON = function(options) {
|
|||||||
tileLoadFunction: options.tileLoadFunction
|
tileLoadFunction: options.tileLoadFunction
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
var request = new goog.net.Jsonp(options.url);
|
||||||
* @private
|
request.send(undefined, goog.bind(this.handleTileJSONResponse, this));
|
||||||
* @type {!goog.async.Deferred}
|
|
||||||
*/
|
|
||||||
this.deferred_ = goog.net.jsloader.load(options.url, {cleanupWhenDone: true});
|
|
||||||
this.deferred_.addCallback(this.handleTileJSONResponse, this);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.source.TileJSON, ol.source.TileImage);
|
goog.inherits(ol.source.TileJSON, ol.source.TileImage);
|
||||||
@@ -65,9 +45,9 @@ goog.inherits(ol.source.TileJSON, ol.source.TileImage);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
|
* @param {TileJSON} tileJSON Tile JSON.
|
||||||
*/
|
*/
|
||||||
ol.source.TileJSON.prototype.handleTileJSONResponse = function() {
|
ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {
|
||||||
var tileJSON = ol.tilejson.grids_.pop();
|
|
||||||
|
|
||||||
var epsg4326Projection = ol.proj.get('EPSG:4326');
|
var epsg4326Projection = ol.proj.get('EPSG:4326');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user