修改原始碼 : https://github.com/zembaalbert/jquery-polygon-annotation-on-images
1、移除 jquery.qtips 相依性
2、增加回傳 dom、path 方法於 after_func
使用方法:
<script src="jquery.annotation.js"></script>
$(document).ready(function(){
$('#annotation').annotation({
image: 'https://raw.githubusercontent.com/zembaalbert/jquery-polygon-annotation-on-images/master/img.jpg',
editable: true,
//hiddenInputId: 'annotationsJSON',
after_func: function(doms,path){
console.log(doms);
//$("#"+doms).remove(); //可用來移除結束後的線條
console.log(path); //路徑
}
});
});