@@ -3071,13 +3071,13 @@ SuperMap.Request = {
30713071 url = this._processUrl(url);
30723072 url = SuperMap.Util.urlAppend(url, this._getParameterString(params || {}));
30733073 if (url.length <= 2000) {
3074+ if (SuperMap.Util.isInTheSameDomain(url) || (SuperMap.Support.cors && this._isMVTRequest(url))) {
3075+ return this._fetch(url, params, options, type);
3076+ }
30743077 if (!SuperMap.Util.isInTheSameDomain(url)) {
30753078 url = url.replace('.json', '.jsonp');
30763079 return this._fetchJsonp(url, options);
30773080 }
3078- if (SuperMap.Support.cors) {
3079- return this._fetch(url, params, options, type);
3080- }
30813081 }
30823082 return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
30833083 },
@@ -3107,6 +3107,10 @@ SuperMap.Request = {
31073107 },
31083108
31093109 _processUrl: function (url) {
3110+ if (this._isMVTRequest(url)) {
3111+ return url;
3112+ }
3113+
31103114 if (url.indexOf('.json') === -1) {
31113115 if (url.indexOf("?") < 0) {
31123116 url += '.json'
@@ -3188,8 +3192,13 @@ SuperMap.Request = {
31883192 }
31893193 }
31903194 return paramsArray.join("&");
3195+ },
3196+
3197+ _isMVTRequest: function (url) {
3198+ return (url.indexOf('.mvt') > -1 || url.indexOf('.pbf') > -1);
31913199 }
31923200
3201+
31933202};
31943203module.exports = SuperMap.Request;
31953204
0 commit comments