Skip to content

Commit

Permalink
[fix]ISVJ-7477 分段专题图要素风格错误 review by songym
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiao-supermap committed Mar 13, 2024
1 parent 1bf2435 commit 1f6063b
Show file tree
Hide file tree
Showing 2 changed files with 359 additions and 51 deletions.
6 changes: 4 additions & 2 deletions src/mapboxgl/web-map/WebMapViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,10 @@ export default class WebMapViewModel extends WebMapBase {
}
if (styleGroups) {
for (let i = 0; i < styleGroups.length; i++) {
if (styleGroups[i].start <= tartget && tartget < styleGroups[i].end) {
const startFlag = styleGroups[i].start <= tartget;
const endFlag = tartget < styleGroups[i].end;
const lastEndFlag = i === styleGroups.length - 1 && tartget === styleGroups[i].end;
if (startFlag && (endFlag || lastEndFlag)) {
expression.push(row.properties.index, styleGroups[i].color);
break;
}
Expand All @@ -2255,7 +2258,6 @@ export default class WebMapViewModel extends WebMapBase {
return true;
}, this);
expression.push('rgba(0, 0, 0, 0)');

const source: mapboxglTypes.GeoJSONSourceRaw = {
type: 'geojson',
data: {
Expand Down
Loading

0 comments on commit 1f6063b

Please sign in to comment.