{"action":"created","issue":{"url":"https://api.github.com/repos/TalkingData/inmap/issues/49","repository_url":"https://api.github.com/repos/TalkingData/inmap","labels_url":"https://api.github.com/repos/TalkingData/inmap/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/TalkingData/inmap/issues/49/comments","events_url":"https://api.github.com/repos/TalkingData/inmap/issues/49/events","html_url":"https://github.com/TalkingData/inmap/issues/49","id":381815794,"node_id":"MDU6SXNzdWUzODE4MTU3OTQ=","number":49,"title":"setData是否会导致图层重绘","user":{"login":"yc623213","id":22463550,"node_id":"MDQ6VXNlcjIyNDYzNTUw","avatar_url":"https://avatars1.githubusercontent.com/u/22463550?v=4","gravatar_id":"","url":"https://api.github.com/users/yc623213","html_url":"https://github.com/yc623213","followers_url":"https://api.github.com/users/yc623213/followers","following_url":"https://api.github.com/users/yc623213/following{/other_user}","gists_url":"https://api.github.com/users/yc623213/gists{/gist_id}","starred_url":"https://api.github.com/users/yc623213/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yc623213/subscriptions","organizations_url":"https://api.github.com/users/yc623213/orgs","repos_url":"https://api.github.com/users/yc623213/repos","events_url":"https://api.github.com/users/yc623213/events{/privacy}","received_events_url":"https://api.github.com/users/yc623213/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-17T01:49:12Z","updated_at":"2018-11-19T01:47:54Z","closed_at":null,"author_association":"NONE","body":"你好大佬，我想问个问题，就是所有涂层的setData 是否会导致图层重绘，因为我每次更新数据时都会闪动一下，闪屏，用户体验不是很好，还是我的设置有问题？如果重置，有办法去改善这种闪一下吗？期待大佬回复"},"comment":{"url":"https://api.github.com/repos/TalkingData/inmap/issues/comments/439748079","html_url":"https://github.com/TalkingData/inmap/issues/49#issuecomment-439748079","issue_url":"https://api.github.com/repos/TalkingData/inmap/issues/49","id":439748079,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTc0ODA3OQ==","user":{"login":"fengluhome","id":4446509,"node_id":"MDQ6VXNlcjQ0NDY1MDk=","avatar_url":"https://avatars2.githubusercontent.com/u/4446509?v=4","gravatar_id":"","url":"https://api.github.com/users/fengluhome","html_url":"https://github.com/fengluhome","followers_url":"https://api.github.com/users/fengluhome/followers","following_url":"https://api.github.com/users/fengluhome/following{/other_user}","gists_url":"https://api.github.com/users/fengluhome/gists{/gist_id}","starred_url":"https://api.github.com/users/fengluhome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fengluhome/subscriptions","organizations_url":"https://api.github.com/users/fengluhome/orgs","repos_url":"https://api.github.com/users/fengluhome/repos","events_url":"https://api.github.com/users/fengluhome/events{/privacy}","received_events_url":"https://api.github.com/users/fengluhome/received_events","type":"User","site_admin":false},"created_at":"2018-11-19T01:47:54Z","updated_at":"2018-11-19T01:47:54Z","author_association":"COLLABORATOR","body":"是的，调用setData方法会引起重绘，但画面的闪动的感觉大多情况是由woker运算过长造成的。 \r\nsetData()会引发\r\n1.  woker 墨卡托转换，有聚合算法（聚合图层），异步比较耗时\r\n2. canvas 绘画\r\n优化：\r\n条件： 如果数据不发生改变，只是数据中count权重是个变量，可以优化。\r\n方案： 调用getRenderData()获得缓存绘画数据，遍历更改count值，后者设置style属性样式。修改完数据后，调用refresh方法 ，请参照[https://github.com/TalkingData/inmap/blob/master/examples/PolygonOverlay-Vue.html](url)\r\n"}}
{"actor":{"display_login":"fengluhome"}}