Skip to content

Commit

Permalink
[fix]点和面的文本标签<12级不显示
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiao-supermap committed Apr 17, 2024
1 parent 62cbc37 commit 33f380e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/layers/src/plugins/DataMappingPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ this.adjustData2MapboxCoordinates(mappedData);
this.mapService.version === Version['MAPBOX']
) {
mappedData.map((d) => {
d.version = Version['MAPBOX'];
// @ts-ignore
d.originCoordinates = cloneDeep(d.coordinates); // 为了兼容高德1.x 需要保存一份原始的经纬度坐标数据(许多上层逻辑依赖经纬度数据)
d.originCoordinates = cloneDeep(d.coordinates);
// @ts-ignore
d.coordinates = this.getMapboxCoordiantes(d.coordinates);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/layers/src/point/models/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ export default class TextModel extends BaseModel {

// 此时地图高德2.0 originCentroid == centroid
feature.originCentroid =
feature.version === 'GAODE2.x'
(feature.version === 'GAODE2.x' || feature.version === 'MAPBOX')
? calculateCentroid(feature.originCoordinates)
: (feature.originCentroid = feature.centroid);

Expand Down Expand Up @@ -470,7 +470,7 @@ export default class TextModel extends BaseModel {
// const centroid = feature.centroid as [number, number];
// const centroid = feature.originCentroid as [number, number];
const centroid = (
feature.version === 'GAODE2.x'
(feature.version === 'GAODE2.x' || feature.version === 'MAPBOX')
? feature.originCentroid
: feature.centroid
) as [number, number];
Expand Down

0 comments on commit 33f380e

Please sign in to comment.