From b1d59366dcbd86fcb5a0e4260cb8748caf8cffb0 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 8 Apr 2015 15:56:20 +0200 Subject: [PATCH] Remove ol.format.FormatType.BINARY --- src/ol/featureloader.js | 19 +++---------------- src/ol/format/format.js | 1 - src/ol/has.js | 8 -------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/src/ol/featureloader.js b/src/ol/featureloader.js index e3c7ab279b..a7692c5d86 100644 --- a/src/ol/featureloader.js +++ b/src/ol/featureloader.js @@ -37,15 +37,7 @@ ol.featureloader.loadFeaturesXhr = function(url, format, success) { function(extent, resolution, projection) { var xhrIo = new goog.net.XhrIo(); var type = format.getType(); - var responseType; - // FIXME maybe use ResponseType.DOCUMENT? - if (type == ol.format.FormatType.BINARY && - ol.has.ARRAY_BUFFER) { - responseType = goog.net.XhrIo.ResponseType.ARRAY_BUFFER; - } else { - responseType = goog.net.XhrIo.ResponseType.TEXT; - } - xhrIo.setResponseType(responseType); + xhrIo.setResponseType(goog.net.XhrIo.ResponseType.TEXT); goog.events.listen(xhrIo, goog.net.EventType.COMPLETE, /** * @param {Event} event Event. @@ -58,14 +50,9 @@ ol.featureloader.loadFeaturesXhr = function(url, format, success) { 'event.target/xhrIo is an instance of goog.net.XhrIo'); if (xhrIo.isSuccess()) { var type = format.getType(); - /** @type {ArrayBuffer|Document|Node|Object|string|undefined} */ + /** @type {Document|Node|Object|string|undefined} */ var source; - if (type == ol.format.FormatType.BINARY && - ol.has.ARRAY_BUFFER) { - source = xhrIo.getResponse(); - goog.asserts.assertInstanceof(source, ArrayBuffer, - 'source is an instance of ArrayBuffer'); - } else if (type == ol.format.FormatType.JSON) { + if (type == ol.format.FormatType.JSON) { source = xhrIo.getResponseText(); } else if (type == ol.format.FormatType.TEXT) { source = xhrIo.getResponseText(); diff --git a/src/ol/format/format.js b/src/ol/format/format.js index bdedb916d1..e0cca0fdae 100644 --- a/src/ol/format/format.js +++ b/src/ol/format/format.js @@ -5,7 +5,6 @@ goog.provide('ol.format.FormatType'); * @enum {string} */ ol.format.FormatType = { - BINARY: 'binary', JSON: 'json', TEXT: 'text', XML: 'xml' diff --git a/src/ol/has.js b/src/ol/has.js index f86249f976..b68ea55867 100644 --- a/src/ol/has.js +++ b/src/ol/has.js @@ -17,14 +17,6 @@ goog.require('ol.webgl'); ol.has.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1; -/** - * True if the browser supports ArrayBuffers. - * @const - * @type {boolean} - */ -ol.has.ARRAY_BUFFER = 'ArrayBuffer' in goog.global; - - /** * True if the browser's Canvas implementation implements {get,set}LineDash. * @type {boolean}