由于我无法使用服务器端的StyledLayerDescriptor(SLD)编码,我既不想加载外部图形,也不想使用CSS来设置OpenLayers的点功能。 详细地说,我想用不同颜色填充一半(或1/3)点特征。
CSS代码可能是
#OpenLayers\.Geometry\.Point_111{
fill: red !important;
background: -moz-linear-gradient(-45deg, #ce275f 50%, #1e5799 50%, #207cca 50%, #7db9e8 100%) !important; /* FF3.6+ */
}
该功能未分配给班级。 那可能吗?还有其他可能性吗?
答案 0 :(得分:0)
我立刻想到了这个:
.circle {
height: 100px;
width: 100px;
border-radius: 50%;
background: #000000; /* Old browsers */
background: -moz-linear-gradient(left, #000000 1%, #000000 50%, #ff00ff 50%, #ff00ff 100%, #ff00ff 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(1%,#000000), color-stop(50%,#000000), color-stop(50%,#ff00ff), color-stop(100%,#ff00ff), color-stop(100%,#ff00ff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #000000 1%,#000000 50%,#ff00ff 50%,#ff00ff 100%,#ff00ff 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #000000 1%,#000000 50%,#ff00ff 50%,#ff00ff 100%,#ff00ff 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #000000 1%,#000000 50%,#ff00ff 50%,#ff00ff 100%,#ff00ff 100%); /* IE10+ */
background: linear-gradient(to right, #000000 1%,#000000 50%,#ff00ff 50%,#ff00ff 100%,#ff00ff 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#ff00ff',GradientType=1 ); /* IE6-9 */
}