常见问题 > 详情

2D图纸如何调用Annotation的接口,实现画批注的效果?

//创建批注
function createAnnotation(viewer){

var config = new Glodon.Bimface.Plugins.Annotation.AnnotationToolbarConfig();
config.viewer = viewer;//2D图纸
annotationToolbar = new Glodon.Bimface.Plugins.Annotation.AnnotationToolbar(config);
AnnotationToolbarEvent = Glodon.Bimface.Plugins.Annotation.AnnotationToolbarEvent
annotationToolbar.addEventListener(AnnotationToolbarEvent.Saved,function(list){
  list = list;
});
annotation = annotationToolbar.getAnnotationManager();
annotationToolbar.show()
}

//导出截屏
var prop = document.getElementById("prop");
var content = document.getElementById("content");
var close = document.getElementById("close");
document.getElementById("createSnapshot").addEventListener("click",function(){

annotation.createSnapshot(function(image){
  var img = new Image();
  img.src = image;
  prop.style.display = "block";
  content.innerHTML = "";
  content.appendChild(img);
})
});

image