Want to remove Picture from linkTemplate

Hi,

Below is my linkTemplate code. I want to remove picture from linkTemplate. How can i achieve this?

mainDiagram.linkTemplate =
$go(go.Link,
{
routing: go.Link.AvoidsNodes,
curve: go.Link.JumpOver,
corner: 5,
toShortLength: 4,
selectable: false,
layoutConditions: go.Part.LayoutAdded | go.Part.LayoutRemoved,
// links cannot be selected, so they cannot be deleted
// If a node from the pallette is dragged over this node, its outline will turn green
mouseDragEnter: function(e, link) { link.isHighlighted = true; },
mouseDragLeave: function(e, link) { link.isHighlighted = false; },
// if a node from the Palette is dropped on a link, the link is replaced by links to and from the new node
mouseDrop: dropOntoLink
},
$go(go.Shape, linkShapeStyle()),
$go(go.Picture,AddImageStaticResource),
$go(go.Shape,
{ toArrow: “standard”, stroke: null, fill: “Grey” })
)

Thanks in advance.

Ummm, I don’t understand your question. It seems quite obvious to me that you just delete the line that you have put in bold. So you’ve got to be asking some question that is more involved than that, but I don’t know what it is that you want to accomplish.

Thanks for the reply.
Actually i want to use this linkTemplate for 2 scenarios. In 1st scenario, i want picture in linkTemplate, but in 2nd Scenario, i don’t want picture in linkTemplate. Yes ,i can achieve this by writing 2 different linkTemplates. But i don’t want to duplicate my code. Thats why i was asking, whether is there any way to delete picture from linkTemplate.
Thanks

Ah, OK, that makes sense. There’s no way to modify the template dynamically, adding or removing objects, because that would not affect any existing Parts copied from the template.

Basically you want to use data binding of the GraphObject.visible property. You can find lots of examples throughout the Introduction pages and the samples – just search for go.Binding("visible".