View unanswered posts | View active topics It is currently 2020-09-19 7:15



Reply to topic  [ 4 posts ] 
 shapelink 连线过程中 如何获取各个点的坐标 
Author Message
初级会员

Joined: 2017-12-04 9:31
Posts: 130
Post shapelink 连线过程中 如何获取各个点的坐标
network.setCreateShapeLinkInteractions(function(fromNode,toNode) {
var link = new twaver.ShapeLink(fromNode, toNode);
box.add(link);
})


Attachments:
aaaa.png
aaaa.png [ 33.56 KiB | Viewed 1418 times ]
2019-10-28 9:01
Profile
TWaver开发组
User avatar

Joined: 2019-04-23 11:02
Posts: 99
Post Re: shapelink 连线过程中 如何获取各个点的坐标
在连线整体画完之前会拿到这points,不是打点时候获取,想要打点时候获取可以监听一下点击事件
Code:
          network.setInteractions([
            new twaver.vector.interaction.CreateShapeLinkInteraction(
              network,
              function(fromNode, toNode, points) {
                var link = new twaver.ShapeLink();
                link.setFromNode(fromNode);
                link.setToNode(toNode);
                console.log(points)
                if (points) {
                  link.setPoints(points);
                }
                return link;
              }
            ),
            new twaver.vector.interaction.DefaultInteraction(network)
          ]);
        })


2019-12-16 10:18
Profile
初级会员

Joined: 2017-12-04 9:31
Posts: 130
Post Re: shapelink 连线过程中 如何获取各个点的坐标
贴子发出好久才有人回复,经过自己摸索已经知道咋搞了,和你的一样,还是很感谢您的回复;官方已经long long long ago不解答问题了


2019-12-16 23:54
Profile
TWaver开发组
User avatar

Joined: 2017-02-22 10:01
Posts: 424
Post Re: shapelink 连线过程中 如何获取各个点的坐标
不好意思,我们从来没放弃过呢!感谢您的支持!


2019-12-17 17:21
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron