File tree Expand file tree Collapse file tree 3 files changed +546
-448
lines changed Expand file tree Collapse file tree 3 files changed +546
-448
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,10 @@ class MapDraw {
302
302
? mapOrGeoModel . getRegionModel ( regionName )
303
303
: ( data ? data . getItemModel ( dataIdx ) as Model < MapDataItemOption > : null ) ;
304
304
305
+ // allow specified echarts style in GeoJSON data
306
+ const specifiedRegionStyle = region . properties && region . properties . echartsStyle ;
307
+ specifiedRegionStyle && zrUtil . merge ( regionModel . option , specifiedRegionStyle ) ;
308
+
305
309
regionsInfoByName . set ( regionName , { dataIdx, regionModel } ) ;
306
310
}
307
311
Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ import * as vec2 from 'zrender/src/core/vector';
23
23
import * as polygonContain from 'zrender/src/contain/polygon' ;
24
24
import { GeoJSON , GeoProjection , GeoSVGGraphicRoot } from './geoTypes' ;
25
25
import * as matrix from 'zrender/src/core/matrix' ;
26
- import Element from 'zrender/src/Element' ;
26
+ import type Element from 'zrender/src/Element' ;
27
27
import { each } from 'zrender/src/core/util' ;
28
+ import type { RegoinOption } from './GeoModel' ;
28
29
29
30
const TMP_TRANSFORM = [ ] as number [ ] ;
30
31
@@ -135,7 +136,9 @@ export class GeoJSONRegion extends Region {
135
136
readonly geometries : ( GeoJSONPolygonGeometry | GeoJSONLineStringGeometry ) [ ] ;
136
137
137
138
// Injected outside.
138
- properties : GeoJSON [ 'features' ] [ 0 ] [ 'properties' ] ;
139
+ properties : GeoJSON [ 'features' ] [ 0 ] [ 'properties' ] & {
140
+ echartsStyle ?: Omit < RegoinOption , 'name' | 'selected' >
141
+ } ;
139
142
140
143
constructor (
141
144
name : string ,
You can’t perform that action at this time.
0 commit comments