I'm trying to create a custom Polygon
style for my layer style.
I receive some information about position, orientation and age for a number of objects and I want to represent those as zoom independent (like using Icons
or RegularShapes
) isosceles triangles, pointing at an angle and color-coded according to age.
I have a good idea of the color-coding and rotation part, but I'm stumped at creating an isosceles triangle using the style objects provided by OpenLayers.
This is what I have so far:
style = [new ol.style.Style({
geometry: function(feature) {
return new ol.geom.Polygon([[
[0, 0],
[2, 0],
[1, 3]
]]);
},
fill: new ol.style.Fill({color: '#000'}) //black right now
})]
Circle
,Icon
andRegularShape
as "point" styles. I need to define a custom shape that doesn't fit into any of these types.