How to properly generate map image on client-side using html2canvas?

1866
1
Jump to solution
01-23-2018 03:15 AM
CarlosNantes
New Contributor III

Hello, guys.

I'm using js api 3.x and that html2canvas library to generate map image on the client side. If I add a feature to the map and generate the image, all goes well. But, if I add a feature to the map, pan the map a little, the feature doesn't show in the final image. If I zoom in or out and try to generate the image again, the feature is shown in the final image. Have any of you used successfully this library to generate map image? 

I can't use the Print widget to create the image on the server because I get an error with the message "Not enough memory to create requested bitmap". This error started after I publish a Mapserver of an orthophoto. Although I have generated the cache, it seems the server is not using the cache to create the image.

EDIT:
I have found that the issue happens only on google chrome, but it all works well on firefox. But, I still have no clue how to solve it on chrome.

0 Kudos
1 Solution

Accepted Solutions
CarlosNantes
New Contributor III

I have solved the problem changing map.navigationMode to 'classic'. Previously, it was 'css-transforms'. 

It seems that css transforms aren't supported yet by html2canvas.

View solution in original post

0 Kudos
1 Reply
CarlosNantes
New Contributor III

I have solved the problem changing map.navigationMode to 'classic'. Previously, it was 'css-transforms'. 

It seems that css transforms aren't supported yet by html2canvas.

0 Kudos