I'm working with the OL3 example DrawShapes. There is a "star" as example for a custom draw interaction with a user defined geometry function looking like
draw = new ol.interaction.Draw({
source: source,
type: 'Circle',
geometryFunction:
function(coordinates, geometry) {
if (!geometry) {
geometry = new ol.geom.Polygon(null);
}
//Calculate coordinates and set geometry
}
});
What I am actually trying to achieve is replacing this geometry with a custom SVG. The user should be able to draw these SVGs (basically arrows) with the circle-like two point interaction, just like in the example.
I already parsed the svg to a OL-MultilineString geometry. But when I am trying to replace the Polygon with my custom MultiLineString, the "basic geometry stroke" from center
to last
in the example also appears. Is this intended behavior or not and how can I get rid of this additional line?
Does it make a difference to recreate the geometry every time during the draw interaction or to use deltas and change the geometry continuously?
star with dispensable line in yellow
For testing you can just use the above link and replacing the ol.geom.Polygon(null)
with a ol.geom.MultiLineString(null)
I appreciate every solution including different approaches.