1
這是我的版本。但它不起作用。顯示畫布,但不響應拖輪和縮放。如何將base64解碼圖像添加到開發圖中?
var layer = new ol.layer.Image({
source: new ol.source.ImageCanvas({
canvasFunction: function(){
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
var image = new Image();
canvas.setAttribute('width', attachment.width);
canvas.setAttribute('height', attachment.height);
image.onload = function(){
context.drawImage(image, 0, 0);
};
image.src = attachment.src;
return canvas;
},
projection: view.getProjection()
})
});
您可以提交您自己的問題的答案。當你自己發現解決方案時,實際上是推薦的事情。 – Jason