Allow styles to override feature geometries

With this change, application developers are able to define styles that
render a different geometry than the feature geometry. This can e.g. be
used to render an interior point of a polygon instead of the polygon, or
to render symbols like arrows along lines.
This commit is contained in:
Andreas Hocevar
2014-12-05 13:33:44 +01:00
parent e57ea1e66b
commit 2d12531105
3 changed files with 74 additions and 3 deletions

View File

@@ -6075,7 +6075,8 @@ olx.style.TextOptions.prototype.stroke;
/**
* @typedef {{fill: (ol.style.Fill|undefined),
* @typedef {{geometry: (undefined|string|ol.geom.Geometry|function(ol.Feature): ol.geom.Geometry),
* fill: (ol.style.Fill|undefined),
* image: (ol.style.Image|undefined),
* stroke: (ol.style.Stroke|undefined),
* text: (ol.style.Text|undefined),
@@ -6085,6 +6086,15 @@ olx.style.TextOptions.prototype.stroke;
olx.style.StyleOptions;
/**
* Feature property or geometry or function returning a geometry to render
* for this style.
* @type {undefined|string|ol.geom.Geometry|function(ol.Feature): ol.geom.Geometry}
* @api
*/
olx.style.StyleOptions.prototype.geometry;
/**
* Fill style.
* @type {ol.style.Fill|undefined}