editing TextSymbol with halo stomps on haloColor

1595
2
06-08-2017 11:20 AM
DougAlcorn
New Contributor

I'm adding a point with a TextSymbol to a map that has a haloColor and haloSize set. When I activate an Edit toolbar with either Edit.EDIT_TEXT, Edit.SCALE, or Edit.ROTATE a SymbolEditor pops up to edit the alignment, color and halo color of the symbol. The SymbolEditor correctly detects the TextSymbol's color, but does not detect the haloColo and forces it to white. Even if I use the "textSymbolEditorHolder" option to locate the SymbolEditor into a specific div with style display none, it still overrides the haloColor to be white. I don't see any way to not pop up the SymbolEditor.

Here's a jsbin that demonstrates the problem pretty simply http://jsbin.com/gefidez/5/edit

0 Kudos
2 Replies
JohnGrayson
Esri Regular Contributor

This only happens the first time the text symbol editor is created.  One possible workaround is to activate the edit toolbar with a temp graphic and then remove it.

var otherGraphic = new Graphic(point, text);
map.graphics.add(otherGraphic);
editTool.activate(Edit.SCALE, otherGraphic);
editTool.deactivate();
map.graphics.remove(otherGraphic);
DougAlcorn
New Contributor

Thanks, John, for your work around. Here's my latest jsbin with your work around. You're right that after that first time the text symbol editor is created, it's able to properly read the haloColor of other text symbols.

However, in the jsbin the text symbol editor doesn't disappear when I first deactivate it. It only disappears after the second time I call deactivate(). I suppose I could just specify the textSymbolEditorHolder and put it in a hidden div. That would allow me to use Edit.SCALE and Edit.ROTATE on TextSymbols without it messing up the haloColor. However, this automatic text symbol editor tie in with the edit tool seems like it needs more work. I'd love to just be able to turn it off in the Edit options. Even better, I could just turn off which of the three panels of the text symbol editor I don't want. I'd like to allow my users to set the foreground color, but not alignment or haloColor.

0 Kudos