Tengo 2 puntos sobre lienzo. Digamos el punto A [x=4,1549997, y=4,005] y el punto B [x=2,77, y=3,5749998]
Ahora, quiero dibujar una flecha de arco desde Point-A > Point-B AND Point-B > Point-A usando OpenLayers 3 Library.
Hasta ahora, he podido crear con éxito flechas rectas usando LineString. Pero no pude encontrar ninguna funcionalidad incorporada proporcionada por OpenLayer para dibujar ARC entre 2 puntos.
var me = this; var line = new ol.geom.LineString(coordinate); var fl = new ol.Feature({ name: "line", geometry: line }); fl.setProperties({ 'coordinate': coordinate }); fl.setStyle( function(feature, resolution) { return me.getStyles(fl); }); return fl; getStyles: function (fObj) { var geometry = fObj.getGeometry(); var styles = [new ol.style.Style({ stroke: new ol.style.Stroke({ width: 5, color: 'rgb(21,150,18)', lineDash: [.2,5] }) })]; geometry.forEachSegment(function(start, end) { var dx = end[0] - start[0]; var dy = end[1] - start[1]; var rotation = Math.atan2(dy, dx); styles.push(new ol.style.Style({ geometry: new ol.geom.Point(end), image: new ol.style.Icon({ src: '../images/arrow_test.png', anchor: [0.75, 0.5], rotateWithView: true, rotation: -rotation }) })); }) return styles; },¿Alguien puede ayudarme aquí con respecto a esto?
Nota - Además, hay una cosa más que también me preocupa. Cuando se dibujan varios ARC entre el punto A y el punto B , no deben superponerse entre sí.