Select to view content in your preferred language

Copy To ClipBoard Coordinate on MapClick

418
1
01-23-2019 03:50 PM
dimeh
by
New Contributor

Hi,

I want to copy coordinate to ClipBoad when MapClick is fire after clicking a cutom widget,

There is my code in attachedbfile, if you can help me to find a solution.

thank you

0 Kudos
1 Reply
PrashantKirpan
Frequent Contributor

Hi

Try this,

var el = document.createElement('textarea');
el.value = "SampleData";
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);

"SampleData" = Convert Map coordinates in string.

Working sample code on button click.

Regards,

Prashant

0 Kudos