Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/chart/map/MapSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export interface MapDataItemOption extends MapStateOption,
StatesOptionMixin<MapStateOption, StatesMixinBase>,
OptionDataItemObject<OptionDataValueNumeric> {
cursor?: string
z?: number
silent?: boolean
}

export type MapValueCalculationType = 'sum' | 'average' | 'min' | 'max';
Expand Down
6 changes: 6 additions & 0 deletions src/component/helper/MapDraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,12 @@ class MapDraw {
viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt
);

const z = (regionModel as Model<RegionOption>).get('z', true);
Comment thread
Ovilia marked this conversation as resolved.
Outdated
z != null && (compoundPath.attr('z', z));
Comment thread
Ovilia marked this conversation as resolved.
Outdated

const silent = (regionModel as Model<RegionOption>).get('silent', true);
Comment thread
Ovilia marked this conversation as resolved.
Outdated
silent != null && (compoundPath.silent = silent);

if (isLine) {
fixLineStyle(compoundPath);
zrUtil.each(compoundPath.states, fixLineStyle);
Expand Down
4 changes: 4 additions & 0 deletions src/coord/geo/GeoModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export interface RegionOption extends GeoStateOption, StatesOptionMixin<GeoState
name?: string
selected?: boolean
tooltip?: CommonTooltipOption<GeoTooltipFormatterParams>
z?: number
silent?: boolean
}

/**
Expand Down Expand Up @@ -138,6 +140,8 @@ class GeoModel extends ComponentModel<GeoOption> {
static type = 'geo';
readonly type = GeoModel.type;

preventAutoZ = true;
Comment thread
Ovilia marked this conversation as resolved.
Outdated

coordinateSystem: Geo;

static layoutMode = 'box' as const;
Expand Down
15 changes: 8 additions & 7 deletions src/coord/geo/geoCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,17 @@ class GeoCreator implements CoordinateSystemCreator {
const source = geoSourceManager.load(mapName, nameMap, nameProperty);
zrUtil.each(source.regions, function (region) {
const name = region.name;
if (!dataNameMap.get(name)) {
const regionOption = {
name: name
let regionOption = dataNameMap.get(name);
// apply specified echarts style in GeoJSON data
const specifiedGeoJSONRegionStyle = (region as GeoJSONRegion).properties
&& (region as GeoJSONRegion).properties.echartsStyle;
if (!regionOption) {
regionOption = {
name: name
};
// apply specified echarts style in GeoJSON data
const specifiedGeoJSONRegionStyle = (region as GeoJSONRegion).properties
&& (region as GeoJSONRegion).properties.echartsStyle;
specifiedGeoJSONRegionStyle && zrUtil.merge(regionOption, specifiedGeoJSONRegionStyle);
regionsArr.push(regionOption);
}
specifiedGeoJSONRegionStyle && zrUtil.merge(regionOption, specifiedGeoJSONRegionStyle);
});

return regionsArr;
Expand Down
79 changes: 79 additions & 0 deletions test/data/map/js/china-map.js

Large diffs are not rendered by default.

55 changes: 30 additions & 25 deletions test/effectScatter.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.