Skip to content

Commit

Permalink
【fix】修复4214不出图问题,proj4>=2.7.5不需要转坐标顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
songyumeng committed Nov 26, 2024
1 parent 60f6191 commit d2804b7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/common/mapping/WebMapV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo }) {
this.fire('mapcreatefailed', { error });
}
} else {
this._defineProj4(projection);
wkt = mapRepo.CRS.get(this.baseProjection).WKT
this._defineProj4(wkt);
bounds = [
mapInfo.extent.leftBottom.x,
mapInfo.extent.leftBottom.y,
Expand Down Expand Up @@ -2674,16 +2675,16 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo }) {
return styleParameters;
}

_unproject(point, isReverse = true) {
_unproject(point) {
const sourceProjection = this._unprojectProjection || this.baseProjection;
if (sourceProjection === 'EPSG:4326') {
return point;
}
const coor = transformCoodinates({ coordinates: point, sourceProjection, proj4: this.specifiedProj4 });
const proj = getProjection(sourceProjection, this.specifiedProj4);
if (isReverse && proj.axis && proj.axis.indexOf('ne') === 0) {
coor.reverse();
}
// const proj = getProjection(sourceProjection, this.specifiedProj4);
// if (isReverse && proj.axis && proj.axis.indexOf('ne') === 0) {
// coor.reverse();
// }
return coor;
}

Expand Down

0 comments on commit d2804b7

Please sign in to comment.