我试图在Leaflet的某些svg路径中添加一些过滤器,以显示对象的不同“状态”,以提醒最终用户该特定对象出了问题。
我遇到的问题是滤镜在缩放时会发生变化,当缩小(路径变小)时,“发光”保持相同的大小(相对于路径变大),我需要它相对于路径保持不变路径而不是显示。例如,请参见下面的图片。
这是我的过滤器:
<filter id='polygonStatus-endOfLife' filterRes="10 10" x="-20%" y="-20%" width="140%" height="140%"
filterUnits="objectBoundingBox" primitiveUnits="userSpaceonUse" color-interpolation-filters="linearRGB">
<feComposite in="SourceAlpha" in2="SourceAlpha" operator="arithmetic" k1="0" k2="8" k3="-0.5" k4="-0.5" x="0%" y="0%" width="100%" height="100%" result="composite"/>
<feColorMatrix type="matrix" values="1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0" x="0%" y="0%" width="100%" height="100%" in="composite" result="colormatrix1"/>
<feMorphology operator="dilate" radius="10 10" x="0%" y="0%" width="100%" height="100%" in="colormatrix1" result="morphology1"/>
<feGaussianBlur stdDeviation="10 10" x="0%" y="0%" width="100%" height="100%" in="morphology1" edgeMode="none" result="blur2"/>
<feComposite in="blur2" in2="composite" operator="out" x="0%" y="0%" width="100%" height="100%" result="composite2"/>
<feMerge x="0%" y="0%" width="100%" height="100%" result="merge">
<feMergeNode in="composite2"/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
我希望它更接近“放大”图像上的外观,更加微妙。我基本上需要它像您调整位图图像的大小一样(将第二个屏幕截图的大小调整为较小以了解我的意思)