传单簇组背景颜色未出现在地图打印导出中
Leaflet cluster group background color does not appear in map print export
我有一张带有 L.markerClusterGroup 的传单地图。它看起来像这样:
但是当打印(到 PDF)时,它看起来像这样:
注意没有背景颜色。
点创建如下:
L.DivIcon({ html: '<div><span>' + (childCount + tally) + '</span></div>', className: 'marker-cluster' + <my own css>, iconSize: new L.Point(40, 40) });
其中 "my own css" 是 css 类 可能是以下任何一项:
background: rgba(255, 0, 192, 0.3); !important;
border: 1px solid #666;
或
background: rgba(9, 243, 33, 0.6);!important;
border: 1px solid #666;
还有其他人遇到过同样的问题吗?
我的问题很糟糕 CSS。 background: rgba(255, 0, 192, 0.3); !important;
而不是 background: rgba(255, 0, 192, 0.3) !important;
.
这是工作 CSS:
@media print {
.my-own-css1, .my-own-css2, {
-webkit-print-color-adjust: exact !important;
background: rgba(255, 0, 192, 0.3) !important;
}
}
我有一张带有 L.markerClusterGroup 的传单地图。它看起来像这样:
但是当打印(到 PDF)时,它看起来像这样:
注意没有背景颜色。
点创建如下:
L.DivIcon({ html: '<div><span>' + (childCount + tally) + '</span></div>', className: 'marker-cluster' + <my own css>, iconSize: new L.Point(40, 40) });
其中 "my own css" 是 css 类 可能是以下任何一项:
background: rgba(255, 0, 192, 0.3); !important;
border: 1px solid #666;
或
background: rgba(9, 243, 33, 0.6);!important;
border: 1px solid #666;
还有其他人遇到过同样的问题吗?
我的问题很糟糕 CSS。 background: rgba(255, 0, 192, 0.3); !important;
而不是 background: rgba(255, 0, 192, 0.3) !important;
.
这是工作 CSS:
@media print {
.my-own-css1, .my-own-css2, {
-webkit-print-color-adjust: exact !important;
background: rgba(255, 0, 192, 0.3) !important;
}
}