Daan Terra
Daan Terra

Reputation: 73

Include custom markers in export

I'm trying to export an AmMap with custom markers on it. This example show some custom markers, try exporting the map and you'll find that it has no markers at all in the image: https://codepen.io/anon/pen/gwNevz

The main method of adding the custom markers is to add it as a separate DOM child:

image.chart.chartDiv.appendChild( holder );

This is essentially the AmCharts example (https://www.amcharts.com/demos/custom-html-elements-map-markers/) but with exporting enabled

The standard export plugin omit the custom markers. I tried adding the custom markers to other divs, but it did not matter. I also tried AmMaps-independent approaches (eg html2canvas) but those were unsuccessful so far.

Any ideas how to do this?

Upvotes: 0

Views: 320

Answers (1)

xorspark
xorspark

Reputation: 16012

Unfortunately it isn't possible, which is why the demo has export disabled. The export converts the underlying SVG in the chart div to an image. Non-SVG elements like the div markers won't get exported. You'll have to use the default markers or create your own as images through the svgPath property.

Upvotes: 1

Related Questions