fixed IE fix Vizzuality/gbif#15
This commit is contained in:
parent
e658a5ec15
commit
9086919abe
@ -2,9 +2,9 @@
|
||||
|
||||
exports.torque = exports.torque || {};
|
||||
|
||||
var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
|
||||
var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function(c) { setTimeout(c, 16); }
|
||||
|
||||
var cancelAnimationFrame = window.requestAnimationFrame || window.mozCancelAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
|
||||
var cancelAnimationFrame = window.requestAnimationFrame || window.mozCancelAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function(c) { cancelTimeout(c); };
|
||||
|
||||
/**
|
||||
* options:
|
||||
|
@ -63,7 +63,6 @@ GMapsTorqueLayer.prototype = _.extend({},
|
||||
|
||||
this.provider = new this.providers[this.options.provider](this.options);
|
||||
this.renderer = new this.renderers[this.options.renderer](this.getCanvas(), this.options);
|
||||
console.log(this.getCanvas());
|
||||
|
||||
this._initTileLoader(this.options.map, this.getProjection());
|
||||
|
||||
|
@ -1,8 +1,12 @@
|
||||
(function(exports) {
|
||||
|
||||
exports.torque = exports.torque || {};
|
||||
var torque = exports.torque = exports.torque || {};
|
||||
var providers = exports.torque.providers = exports.torque.providers || {};
|
||||
|
||||
var Uint8Array = torque.types.Uint8Array;
|
||||
var Int32Array = torque.types.Int32Array;
|
||||
var Uint32Array = torque.types.Uint32Array;
|
||||
|
||||
// format('hello, {0}', 'rambo') -> "hello, rambo"
|
||||
function format(str) {
|
||||
for(var i = 1; i < arguments.length; ++i) {
|
||||
|
@ -1,8 +1,13 @@
|
||||
(function(exports) {
|
||||
|
||||
exports.torque = exports.torque || {};
|
||||
|
||||
var torque = exports.torque = exports.torque || {};
|
||||
var providers = exports.torque.providers = exports.torque.providers || {};
|
||||
|
||||
var Uint8Array = torque.types.Uint8Array;
|
||||
var Int32Array = torque.types.Int32Array;
|
||||
var Uint32Array = torque.types.Uint32Array;
|
||||
|
||||
// format('hello, {0}', 'rambo') -> "hello, rambo"
|
||||
function format(str, attrs) {
|
||||
for(var i = 1; i < arguments.length; ++i) {
|
||||
@ -51,6 +56,9 @@
|
||||
return keys;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -2,17 +2,28 @@
|
||||
var torque = exports.torque = exports.torque || {};
|
||||
torque.net = torque.net || {};
|
||||
|
||||
|
||||
function get(url, callback) {
|
||||
var req = new XMLHttpRequest();
|
||||
req.onreadystatechange = function() {
|
||||
if (req.readyState == 4){
|
||||
if (req.status == 200){
|
||||
var request = XMLHttpRequest;
|
||||
// from d3.js
|
||||
if (window.XDomainRequest
|
||||
&& !("withCredentials" in request)
|
||||
&& /^(http(s)?:)?\/\//.test(url)) request = XDomainRequest;
|
||||
var req = new request();
|
||||
|
||||
|
||||
function respond() {
|
||||
var status = req.status, result;
|
||||
if (!status && req.responseText || status >= 200 && status < 300 || status === 304) {
|
||||
callback(req);
|
||||
} else {
|
||||
callback(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
"onload" in req
|
||||
? req.onload = req.onerror = respond
|
||||
: req.onreadystatechange = function() { req.readyState > 3 && respond(); };
|
||||
|
||||
req.open("GET", url, true);
|
||||
//req.responseType = 'arraybuffer';
|
||||
|
Loading…
Reference in New Issue
Block a user