Skip to content

Commit

Permalink
Merge pull request openlayers#2007 from fredj/tilejson-jsonp
Browse files Browse the repository at this point in the history
Use goog.net.Jsonp instead of goog.net.jsloader
  • Loading branch information
fredj committed Apr 22, 2014
2 parents 3ffed43 + 1d688ad commit 16d7999
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions src/ol/source/tilejsonsource.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ goog.provide('ol.source.TileJSON');
goog.provide('ol.tilejson');

goog.require('goog.asserts');
goog.require('goog.net.jsloader');
goog.require('goog.net.Jsonp');
goog.require('ol.Attribution');
goog.require('ol.TileRange');
goog.require('ol.TileUrlFunction');
Expand All @@ -20,22 +20,6 @@ goog.require('ol.source.TileImage');
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
Expand All @@ -52,22 +36,18 @@ ol.source.TileJSON = function(options) {
tileLoadFunction: options.tileLoadFunction
});

/**
* @private
* @type {!goog.async.Deferred}
*/
this.deferred_ = goog.net.jsloader.load(options.url, {cleanupWhenDone: true});
this.deferred_.addCallback(this.handleTileJSONResponse, this);
var request = new goog.net.Jsonp(options.url);
request.send(undefined, goog.bind(this.handleTileJSONResponse, this));

};
goog.inherits(ol.source.TileJSON, ol.source.TileImage);


/**
* @protected
* @param {TileJSON} tileJSON Tile JSON.
*/
ol.source.TileJSON.prototype.handleTileJSONResponse = function() {
var tileJSON = ol.tilejson.grids_.pop();
ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {

var epsg4326Projection = ol.proj.get('EPSG:4326');

Expand Down

0 comments on commit 16d7999

Please sign in to comment.