2
在Openlayers v2
我可以添加喜歡的符號:的OpenLayers 3 - 創建類似的OpenLayers自定義符號2 - > OpenLayers.Renderer.symbol.anySymbol
OpenLayers.Renderer.symbol.pointToIcon = [100, 70, 20, 50, 42, 70, 20, 90];
如何我的OpenLayers 3做呢?
在openlayers 3
我可以使用此功能:
var starSymbol = new ol.style.RegularShape({
points: 4,
opacity: .5,
radius: 10,
radius2: 10 * .5,
angle: 130,
fill: new ol.style.Fill({
color: "blue"
}),
stroke: new ol.style.Stroke({
color: "red",
width: 1
})
});
我可以做其他的數字,但我不能做如下圖所示。因爲圖標的顏色是固定的
new ol.style.Style({
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
opacity: 0.75,
src: 'data/icon.png'
}))
})
,我不能用我需要的顏色:
另外,我不使用「圖標」等。
我真的很感激,如果你幫我。
很好的答案!非常感謝 ;) – Pedram