0
drawGeometry方法不会将点样式应用于多边形。这是有道理的,但我有一个要求,多边形功能应表现为适合该功能的笔画+填充样式以及点样式,IMO,不太适合该功能。如何渲染多边形作为点要素?
使用的多边形和点特征样式的组合:
[
{
"fill": {
"pattern": {
"orientation": "diagonal",
"color": "rgba(230,113,26,1)",
"spacing": 3,
"repitition": "repeat"
}
}
},
{
"circle": {
"fill": { "color": "blue" },
"opacity": 1,
"stroke": {
"color": "rgba(0,255,0,1)",
"width": 1
},
"radius": 20
}
},
{
"image": {
"anchor": [
16,
48
],
"imgSize": [
32,
48
],
"anchorXUnits": "pixels",
"anchorYUnits": "pixels",
"src": "http://openlayers.org/en/v3.17.1/examples/data/icon.png"
}
}
]
一个解决方案,我想出了是更换drawGeometry同时调用drawPolygon和drawPoint:
但似乎支持渲染AP应该以其他方式支持使用点样式的olygon。也许在drawPolygon实现中,它应该检测点样式并作出相应的反应?
那[合作](https://rawgit.com/ca0v/ol3 - 色/主/ rawgit.html?运行=实验室/风格观众GEOM =多边形和风格=冲程/坚实,图标/ PNG,文本/文字和调试= 1)! –