I've tried to resolve the next error but without success.
I have the following jQuery and HTML5 code:
<script language="javascript" type="text/javascript">
function doExportMap() {
map.once('postcompose', function(event) {
var canvas = event.context.canvas;
var exportBMPElement = document.createElement('a');
exportBMPElement.download = 'Mapa.bmp';
exportBMPElement.href = canvas.toDataURL('image/bmp');
document.body.appendChild(exportBMPElement);
exportBMPElement.click();
document.body.removeChild(exportBMPElement);
});
map.renderSync();
}
It was working perfectly way, but now, I'm getting the following error:
SecurityError: The operation is insecure.
exportBMPElement.href = canvas.toDataURL('image/bmp');
What is wrong? Any ideas?
The funny is that I'm not loading the image from an external source. The image is from localhost
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…