Hello everybody,
I need help for create a custon polyline when this is start at the gateway.
I saw that event is started in that part of code:
start:
eventBus.on(‘connect.start’, function (event) {
var context = event.context,
visual;
visual = svgCreate('polyline');
svgAttr(visual, {
'stroke': '#333',
'strokeDasharray': [1],
'strokeWidth': 2,
'pointer-events': 'none'
});
svgAppend(canvas.getDefaultLayer(), visual);
context.visual = visual;
});
Finish:
eventBus.on(‘connect.end’, function (event) {
var context = event.context,
source = context.source,
sourcePosition = context.sourcePosition,
target = context.target,
targetPosition = {
x: event.x,
y: event.y
},
canExecute = context.canExecute || canConnect(source, target);
if (!canExecute) {
return false;
}
var attrs = null,
hints = {
connectionStart: sourcePosition,
connectionEnd: targetPosition
};
if (typeof canExecute === 'object') {
attrs = canExecute;
}
modeling.connect(source, target, attrs, hints);
});
But, I don’t know discover when this event comes from the gateway and how can insert the label.