Skip to content

Commit

Permalink
fix: show map name without nameMap
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoluoHe committed Mar 26, 2024
1 parent f22acf7 commit ec2e307
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/vchart/src/series/map/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,15 @@ export class MapSeries<T extends IMapSeriesSpec = IMapSeriesSpec> extends GeoSer
}
const name = datum.properties?.[this._nameProperty];
if (name) {
if (this._spec.nameMap && this._spec.nameMap[name]) {
return this._spec.nameMap[name];
if (this._spec.nameMap) {
if (this._spec.nameMap[name]) {
return this._spec.nameMap[name];
}
}
if (this._spec.showDefaultName) {
// TODO:
// 1. showDefaultName 是一个考虑配置兼容的产物,不然会有 break-change
// 2. 后续大版本升级,这里无需判断条件,直接返回 name 是更合理的
if (this._spec.showDefaultName || !this._spec.nameMap) {
return name;
}
}
Expand Down

0 comments on commit ec2e307

Please sign in to comment.