16 September 2019

ArcGIS Api Html2canvas not outputting/rendering graphics and labels, Also PrintTask with a similar problem.

I'm using ArcGIS API (Legacy 3.23) to show a map, and the user can draw locations.
The locations are added to a graphics layer, and above it I add a label to show the location number.

After that I was exporting the map as an image with the awesome html2canvas library.

Problem is that the exported image was a hit and miss, most of the time if not always lately, it did not render the polygons nor the labels.

After a lot of debugging and modifying the code, the problem is the label symbol's Halo!
removing the Halo resulted in the correct rendering of all graphics and labels.

So I thought of sharing this incase someone else faces the same problem.

One other problem, related to the PrintTask and Export Web Map Task, which wasn't rendering the labels too, I read in some forum post that setting the label(symbol) text as a number is one of the causes, and that turned out to be my problem!

Happy coding.

ArcGIS Server 10.7
ArcGIS API 3.23
html2canvas 0.5
PS: I should be posting this on ESRI forums, but they have a problem with logins.

No comments:

Post a Comment