@@ -70,7 +70,8 @@ const LEGEND_CSS_DEFAULT = {
7070 marginLeft : '1px' ,
7171 outlineStyle : 'none' ,
7272 outlineColor : '#FFFFFF' ,
73- outlineWidth : '0.5px'
73+ outlineWidth : '0.5px' ,
74+ outlineOpacity : 1
7475 } ,
7576 [ LEGEND_RENDER_TYPE . FILLEXTRUSION ] : {
7677 width : '20px' ,
@@ -110,7 +111,7 @@ const LEGEND_STYLE_KEYS = {
110111 [ LEGEND_RENDER_TYPE . POINT ] : [ 'symbolsContent' , 'size' , 'color' , 'opacity' ] ,
111112 [ LEGEND_RENDER_TYPE . BUILTINSYMBOL ] : [ 'symbolsContent' , 'size' , 'color' , 'opacity' ] ,
112113 [ LEGEND_RENDER_TYPE . LINE ] : [ 'width' , 'color' , 'opacity' , 'lineDasharray' , 'symbolsContent' ] ,
113- [ LEGEND_RENDER_TYPE . FILL ] : [ 'color' , 'opacity' , 'antialias' , 'outline' , 'outlineColor' , 'outlineWidth' , 'symbolsContent' ] ,
114+ [ LEGEND_RENDER_TYPE . FILL ] : [ 'color' , 'opacity' , 'antialias' , 'outline' , 'outlineColor' , 'outlineWidth' , 'outlineOpacity' , 'outlineSymbolsContent ', 'symbolsContent' ] ,
114115 [ LEGEND_RENDER_TYPE . FILLEXTRUSION ] : [ 'color' , 'opacity' , 'symbolsContent' ] ,
115116 [ LEGEND_RENDER_TYPE . ANIMATEPOINT ] : [ 'color' , 'opacity' , 'size' , 'speed' , 'rings' ] ,
116117 [ LEGEND_RENDER_TYPE . ANIMATELINE ] : [ 'color' , 'opacity' , 'width' , 'textureBlend' , 'symbolsContent' , 'iconStep' ] ,
@@ -897,7 +898,7 @@ export function createWebMapV3Extending(SuperClass, { MapManager, mapRepo, crsMa
897898 if ( keys ) {
898899 const simpleKeys = keys . filter ( ( k ) => styleSetting [ k ] && styleSetting [ k ] . type === 'simple' ) ;
899900 simpleKeys . forEach ( ( k ) => {
900- const isOutlineKey = k === 'outlineColor' || k === 'outlineWidth' ;
901+ const isOutlineKey = [ 'outlineColor' , 'outlineWidth' , 'outlineOpacity' , 'outlineSymbolsContent' ] . includes ( k ) ;
901902 const hasOutline =
902903 styleSetting &&
903904 (
@@ -1382,13 +1383,36 @@ export function createWebMapV3Extending(SuperClass, { MapManager, mapRepo, crsMa
13821383 }
13831384 } ) ;
13841385 Object . assign ( cssStyle , { outlineStyle : ( customValue . antialias || customValue . outline ) ? 'solid' : 'none' } ) ;
1386+ // 轮廓线符号与轮廓线宽平级,交由图例组件渲染
1387+ if ( customValue . outlineSymbolsContent ) {
1388+ cssStyle . outlineSymbolsContent = customValue . outlineSymbolsContent ;
1389+ // 轮廓图片符号(line-pattern 连续纹理 / icon-image 图标点)的雪碧图信息,
1390+ // 按图片 id 附带在样式上,供图例组件直接裁剪轮廓图块
1391+ const outlineSprites = { } ;
1392+ [ ] . concat ( customValue . outlineSymbolsContent . style || [ ] ) . forEach ( ( outlineSymbol ) => {
1393+ const outlinePaint = ( outlineSymbol && outlineSymbol . paint ) || { } ;
1394+ const outlineLayout = ( outlineSymbol && outlineSymbol . layout ) || { } ;
1395+ const outlineImageId = outlinePaint [ 'line-pattern' ] || outlineLayout [ 'icon-image' ] ;
1396+ if ( outlineImageId && this . _spriteDatas [ outlineImageId ] ) {
1397+ outlineSprites [ outlineImageId ] = this . _spriteDatas [ outlineImageId ] ;
1398+ }
1399+ } ) ;
1400+ if ( Object . keys ( outlineSprites ) . length ) {
1401+ cssStyle . outlineSprites = outlineSprites ;
1402+ }
1403+ }
13851404 if ( this . _spriteDatas [ symbolId ] ) {
13861405 return this . _getSpriteStyle ( symbolId , { ...cssStyle , backgroundColor : 'transparent' } ) ;
13871406 }
1388- return {
1407+ // 纯色面填充 + 图片轮廓符号:样式仍走矢量渲染,附上雪碧图地址供图例组件加载并裁剪轮廓图块
1408+ const legendStyle = {
13891409 type : LEGEND_STYLE_TYPES . STYLE ,
13901410 ...cssStyle
13911411 } ;
1412+ if ( customValue . outlineSymbolsContent && typeof this . _sprite === 'string' ) {
1413+ legendStyle . url = `${ this . _sprite } .png` ;
1414+ }
1415+ return legendStyle ;
13921416 }
13931417 }
13941418 }
0 commit comments