Editable Text on Map

1102
1
10-19-2020 05:54 AM
YashvitNaik
New Contributor III

Hi,

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
mdonnelly
Esri Contributor

Hello,

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

Regards,
Mark