UNPKG

terriajs

Version:

Geospatial data visualization platform.

35 lines (29 loc) 1.02 kB
const defaultValue = require('terriajs-cesium/Source/Core/defaultValue'); const defineProperties = require('terriajs-cesium/Source/Core/defineProperties'); const Resource = require('terriajs-cesium/Source/Core/Resource'); function loadWithXhr(options) { // Take advantage that most parameters are the same var resource = new Resource(options); return resource._makeRequest({ responseType: options.responseType, overrideMimeType: options.overrideMimeType, method: defaultValue(options.method, 'GET'), data: options.data }); } defineProperties(loadWithXhr, { load : { get : function() { return Resource._Implementations.loadWithXhr; }, set : function(value) { Resource._Implementations.loadWithXhr = value; } }, defaultLoad : { get : function() { return Resource._DefaultImplementations.loadWithXhr; } } }); module.exports = loadWithXhr;