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)! –