| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f56746d commit 8b8c55e
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,7 +62,6 @@ export class BaiduMap extends TileImage { | |||
| 62 | 62 | .replace('{z}', tileCoord[0].toString()) | |
| 63 | 63 | .replace('{x}', tileCoord[1].toString()) | |
| 64 | 64 | .replace('{y}', function() { | |
| 65 | - console.log(Util.getOlVersion()); | ||
| 66 | 65 | var y = ['4', '5'].indexOf(Util.getOlVersion()) > -1 ? tileCoord[2] : -tileCoord[2] - 1; | |
| 67 | 66 | return y.toString(); | |
| 68 | 67 | }) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2031,7 +2031,7 @@ export class WebMap extends Observable { | |||
| 2031 | 2031 | //行政规划信息 | |
| 2032 | 2032 | data.content.rows.unshift(data.content.colTitles); | |
| 2033 | 2033 | let { divisionType, divisionField } = layer.dataSource.administrativeInfo; | |
| 2034 | - let geojson = that.excelData2FeatureByDivision(data.content, divisionType, divisionField); | ||
| 2034 | + let geojson = await that.excelData2FeatureByDivision(data.content, divisionType, divisionField); | ||
| 2035 | 2035 | features = that._parseGeoJsonData2Feature({ | |
| 2036 | 2036 | allDatas: { features: geojson.features }, | |
| 2037 | 2037 | fileCode: layer.projection | |
@@ -2621,7 +2621,7 @@ export class WebMap extends Observable { | |||
| 2621 | 2621 | * @returns {Object} geojson对象 | |
| 2622 | 2622 | */ | |
| 2623 | 2623 | excelData2FeatureByDivision(content, divisionType, divisionField) { | |
| 2624 | - let me = this; | ||
| 2624 | + | ||
| 2625 | 2625 | let asyncInport; | |
| 2626 | 2626 | if (divisionType === 'Province') { | |
| 2627 | 2627 | asyncInport = window.ProvinceData; | |
@@ -2631,10 +2631,33 @@ export class WebMap extends Observable { | |||
| 2631 | 2631 | // let geojso; | |
| 2632 | 2632 | asyncInport = window.AdministrativeArea; | |
| 2633 | 2633 | } | |
| 2634 | - if (asyncInport) { | ||
| 2635 | - let geojson = me.changeExcel2Geojson(asyncInport.features, content.rows, divisionType, divisionField); | ||
| 2636 | - return geojson; | ||
| 2634 | + if(asyncInport){ | ||
| 2635 | + return new Promise(resolve => { | ||
| 2636 | + resolve(this.changeExcel2Geojson(asyncInport.features, content.rows, divisionType, divisionField)); | ||
| 2637 | + }); | ||
| 2638 | + } | ||
| 2639 | + if(divisionType === 'GB-T_2260'){ | ||
| 2640 | + return new Promise(resolve => { | ||
| 2641 | + resolve({ | ||
| 2642 | + type: 'FeatureCollection', | ||
| 2643 | + features: [] | ||
| 2644 | + }); | ||
| 2645 | + }); | ||
| 2637 | 2646 | } | |
| 2647 | + const dataName = divisionType === 'City' ? 'MunicipalData' : 'ProvinceData'; | ||
| 2648 | + const dataFileName = divisionType === 'City' ? 'MunicipalData.js' : 'ProvincialData.js'; | ||
| 2649 | + const dataUrl = CommonUtil.urlPathAppend(this.server,`apps/dataviz/libs/administrative_data/${dataFileName}`); | ||
| 2650 | + return FetchRequest.get(this.getRequestUrl(dataUrl), null, { | ||
| 2651 | + withCredentials: false, | ||
| 2652 | + withoutFormatSuffix: true | ||
| 2653 | + }) | ||
| 2654 | + .then(response => { | ||
| 2655 | + return response.text(); | ||
| 2656 | + }) | ||
| 2657 | + .then(result => { | ||
| 2658 | + new Function(result)(); | ||
| 2659 | + return this.changeExcel2Geojson(window[dataName].features, content.rows, divisionType, divisionField); | ||
| 2660 | + }); | ||
| 2638 | 2661 | } | |
| 2639 | 2662 | ||
| 2640 | 2663 | /** | |
| Back | FazBrowse Home | New Git URL |
0 commit comments