Remove ol.format.FormatType.BINARY
This commit is contained in:
committed by
Tim Schaub
parent
6a564597fb
commit
b1d59366dc
+3
-16
@@ -37,15 +37,7 @@ ol.featureloader.loadFeaturesXhr = function(url, format, success) {
|
|||||||
function(extent, resolution, projection) {
|
function(extent, resolution, projection) {
|
||||||
var xhrIo = new goog.net.XhrIo();
|
var xhrIo = new goog.net.XhrIo();
|
||||||
var type = format.getType();
|
var type = format.getType();
|
||||||
var responseType;
|
xhrIo.setResponseType(goog.net.XhrIo.ResponseType.TEXT);
|
||||||
// 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);
|
|
||||||
goog.events.listen(xhrIo, goog.net.EventType.COMPLETE,
|
goog.events.listen(xhrIo, goog.net.EventType.COMPLETE,
|
||||||
/**
|
/**
|
||||||
* @param {Event} event Event.
|
* @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');
|
'event.target/xhrIo is an instance of goog.net.XhrIo');
|
||||||
if (xhrIo.isSuccess()) {
|
if (xhrIo.isSuccess()) {
|
||||||
var type = format.getType();
|
var type = format.getType();
|
||||||
/** @type {ArrayBuffer|Document|Node|Object|string|undefined} */
|
/** @type {Document|Node|Object|string|undefined} */
|
||||||
var source;
|
var source;
|
||||||
if (type == ol.format.FormatType.BINARY &&
|
if (type == ol.format.FormatType.JSON) {
|
||||||
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) {
|
|
||||||
source = xhrIo.getResponseText();
|
source = xhrIo.getResponseText();
|
||||||
} else if (type == ol.format.FormatType.TEXT) {
|
} else if (type == ol.format.FormatType.TEXT) {
|
||||||
source = xhrIo.getResponseText();
|
source = xhrIo.getResponseText();
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ goog.provide('ol.format.FormatType');
|
|||||||
* @enum {string}
|
* @enum {string}
|
||||||
*/
|
*/
|
||||||
ol.format.FormatType = {
|
ol.format.FormatType = {
|
||||||
BINARY: 'binary',
|
|
||||||
JSON: 'json',
|
JSON: 'json',
|
||||||
TEXT: 'text',
|
TEXT: 'text',
|
||||||
XML: 'xml'
|
XML: 'xml'
|
||||||
|
|||||||
@@ -17,14 +17,6 @@ goog.require('ol.webgl');
|
|||||||
ol.has.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1;
|
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.
|
* True if the browser's Canvas implementation implements {get,set}LineDash.
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
|
|||||||
Reference in New Issue
Block a user