File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ export type Geometry = {
4646 readonly rawFields ?: RawFields ;
4747 /** 图形映射规则 */
4848 readonly mapping ?: MappingOptions ;
49+ /** 自定义映射字段 */
50+ readonly customMappingField ?: string ;
4951 /** label 映射通道,因为历史原因导致实现略有区别 */
5052 readonly label ?: Label ;
5153 /** 不同状态的样式 */
@@ -156,6 +158,7 @@ export function geometry<O extends GeometryOptions>(params: Params<O>): Params<O
156158 label,
157159 state,
158160 customInfo,
161+ customMappingField,
159162 } = options ;
160163
161164 // 如果没有 mapping 信息,那么直接返回
@@ -179,7 +182,7 @@ export function geometry<O extends GeometryOptions>(params: Params<O>): Params<O
179182 colorField ? geometry . color ( colorField , color ) : geometry . color ( color ) ;
180183 } else if ( isFunction ( color ) ) {
181184 const { mappingFields, tileMappingField } = getMappingField ( options , 'color' ) ;
182- geometry . color ( tileMappingField , getMappingFunction ( mappingFields , color ) ) ;
185+ geometry . color ( customMappingField || tileMappingField , getMappingFunction ( mappingFields , color ) ) ;
183186 } else {
184187 colorField && geometry . color ( colorField , color ) ;
185188 }
You can’t perform that action at this time.
0 commit comments