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 {
302302 ? mapOrGeoModel . getRegionModel ( regionName )
303303 : ( data ? data . getItemModel ( dataIdx ) as Model < MapDataItemOption > : null ) ;
304304
305+ // allow specified echarts style in GeoJSON data
306+ const specifiedRegionStyle = region . properties && region . properties . echartsStyle ;
307+ specifiedRegionStyle && zrUtil . merge ( regionModel . option , specifiedRegionStyle ) ;
308+
305309 regionsInfoByName . set ( regionName , { dataIdx, regionModel } ) ;
306310 }
307311
Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ import * as vec2 from 'zrender/src/core/vector';
2323import * as polygonContain from 'zrender/src/contain/polygon' ;
2424import { GeoJSON , GeoProjection , GeoSVGGraphicRoot } from './geoTypes' ;
2525import * as matrix from 'zrender/src/core/matrix' ;
26- import Element from 'zrender/src/Element' ;
26+ import type Element from 'zrender/src/Element' ;
2727import { each } from 'zrender/src/core/util' ;
28+ import type { RegoinOption } from './GeoModel' ;
2829
2930const TMP_TRANSFORM = [ ] as number [ ] ;
3031
@@ -135,7 +136,9 @@ export class GeoJSONRegion extends Region {
135136 readonly geometries : ( GeoJSONPolygonGeometry | GeoJSONLineStringGeometry ) [ ] ;
136137
137138 // Injected outside.
138- properties : GeoJSON [ 'features' ] [ 0 ] [ 'properties' ] ;
139+ properties : GeoJSON [ 'features' ] [ 0 ] [ 'properties' ] & {
140+ echartsStyle ?: Omit < RegoinOption , 'name' | 'selected' >
141+ } ;
139142
140143 constructor (
141144 name : string ,
You can’t perform that action at this time.
0 commit comments