Skip to content

Commit

Permalink
fix ExtrudeLineTrail error when map spatialReference is not EPSGE3857 (
Browse files Browse the repository at this point in the history
  • Loading branch information
deyihu authored Sep 21, 2023
1 parent 6207310 commit 61401c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ExtrudeLineTrail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class ExtrudeLineTrail extends BaseObject {
};
const id = `${parentId}-${i}`;
const option = maptalks.Util.extend({}, this.options);
option.parentCenter = center;
option.id = id;
option.center = center;
ExtrudeLineTaskIns.push({
Expand Down
4 changes: 3 additions & 1 deletion src/worker/MeshActor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ function gengerateExtrudeLines(lineStringList: Array<Array<SingleLineStringType>
let height = properties.height || 1;
let cornerRadius = properties.cornerRadius || 0;
let bottomHeight = properties.bottomHeight || 0;
//for ExtrudeLineTrail ,slice lines the center is lineCenter
const parentCenter = properties.parentCenter;
width = getDistance(width, layer, cache);
cornerRadius = getDistance(cornerRadius, layer, cache);
height = getAltitude(height, layer, altCache);
Expand All @@ -212,7 +214,7 @@ function gengerateExtrudeLines(lineStringList: Array<Array<SingleLineStringType>
if (isMercator) {
arrayBuffer = getLineArrayBuffer(lineString, layer);
} else {
arrayBuffer = getLinePosition(lineString, layer, center, false).arrayBuffer;
arrayBuffer = getLinePosition(lineString, layer, parentCenter || center, false).arrayBuffer;
}
transfer.push(arrayBuffer);
data.push(arrayBuffer);
Expand Down

0 comments on commit 61401c6

Please sign in to comment.