Maybe I did something stupid....
I tried to load Bing map in wrapped-html jsReport.
<script type='text/javascript'>
function loadMapScenario() {
$('#mapDiv').html('hello');
// return;
var map = new Microsoft.Maps.Map(document.getElementById('mapDiv'), {
credentials: 'Aj6d5Y92_S-KwO4DkiLxA2kmfjn-4w-vsYHuWuXH67tY2JPV2Ajif4GLAzfqb-i1',
center: new Microsoft.Maps.Location({{:lat}}, {{:lon}}),
showMapTypeSelector: false
});
var pushpin = new Microsoft.Maps.Pushpin(map.getCenter(), {
icon: '
https://www.bingmapsportal.com/Content/images/poi_custom.png',
anchor: new Microsoft.Maps.Point(12, 39)
});
map.entities.push(pushpin);
}
$("#printCommand").click(function() {
var printTemplate = $.extend({}, jsreport.template);
printTemplate.recipe = "phantom-pdf";
printTemplate.content = document.documentElement.outerHTML;
printTemplate.phantom = {
printDelay : 1000, /* wait a little bit for js rendering */
blockJavaScript : false, /* block pivot table from new rendering */
};
jsreport.render(printTemplate);
});
</script>
<body onload='loadMapScenario();'>
<button id="printCommand">Print</button>
. . .
In wrapped-html it works, but when I clcik on the "Print" button to create PDF report it does not render any map if blockJavaScript : true and only renders base map if blockJavaScript : false.
So, what would be the proper way to render map and to include its image in PDF report?