Closed skynice closed 2 years ago
hi,i use mockjs in my project.found the mockjs rewrite window.XMLHttpRequest. when ajax load .shp file the respnse type is string. then you todo like this,
import Mock from 'mockjs' ... ... Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send Mock.XHR.prototype.send = function() { if (this.custom.xhr) { this.custom.xhr.withCredentials = this.withCredentials || false } if(this.responseType==="arraybuffer"){ //load .shp file this.custom.xhr.responseType="arraybuffer" } this.proxy_send(...arguments) }
is there a question ? I don't understand, this seems like a bug with mockjs maybe ?
hi,i use mockjs in my project.found the mockjs rewrite window.XMLHttpRequest. when ajax load .shp file the respnse type is string. then you todo like this,