Editable Text on Map

10-19-2020 05:54 AM
New Contributor III


I am using ArcGIS Javascript API version 4.15 for my desktop web application, and want to draw/edit text symbol on map click.

Have seen an example in sample Editing Tools. if you see the sample link, the text is editable and a color popup appears on click of text. 

trying to replicate the same feature in the 4.15 version, but no luck.

0 Kudos
1 Reply
Esri Contributor


You will need to use a TextSymbol:

TextSymbol | ArcGIS API for JavaScript 4.17 

Code workflow:

1. Have a button that users can click to add text with a listener

2. When the user clicks the button the listener calls a function that prompts the user to click on the map

3. Capture the map click coordinates

4. Prompt the user for the text they wish to write, using a dialog box

5. Add a point graphic to the map using TextSymbol for its symbology