{"action":"closed","issue":{"url":"https://api.github.com/repos/maptalks/maptalks.js/issues/720","repository_url":"https://api.github.com/repos/maptalks/maptalks.js","labels_url":"https://api.github.com/repos/maptalks/maptalks.js/issues/720/labels{/name}","comments_url":"https://api.github.com/repos/maptalks/maptalks.js/issues/720/comments","events_url":"https://api.github.com/repos/maptalks/maptalks.js/issues/720/events","html_url":"https://github.com/maptalks/maptalks.js/issues/720","id":341611606,"node_id":"MDU6SXNzdWUzNDE2MTE2MDY=","number":720,"title":"批量绘制复杂图形时的性能问题","user":{"login":"JoyTroy","id":14498400,"node_id":"MDQ6VXNlcjE0NDk4NDAw","avatar_url":"https://avatars2.githubusercontent.com/u/14498400?v=4","gravatar_id":"","url":"https://api.github.com/users/JoyTroy","html_url":"https://github.com/JoyTroy","followers_url":"https://api.github.com/users/JoyTroy/followers","following_url":"https://api.github.com/users/JoyTroy/following{/other_user}","gists_url":"https://api.github.com/users/JoyTroy/gists{/gist_id}","starred_url":"https://api.github.com/users/JoyTroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoyTroy/subscriptions","organizations_url":"https://api.github.com/users/JoyTroy/orgs","repos_url":"https://api.github.com/users/JoyTroy/repos","events_url":"https://api.github.com/users/JoyTroy/events{/privacy}","received_events_url":"https://api.github.com/users/JoyTroy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-16T17:50:46Z","updated_at":"2018-09-02T03:45:33Z","closed_at":"2018-09-02T03:45:32Z","author_association":"NONE","body":"**maptalks's version and what browser you use?**\r\n----v0.40.2 Google\r\n\r\n**Issue description**\r\n----最近尝试绘制复杂图形时遇到这类性能问题，原理是通过new maptalks.Sector方式绘制了100个扇形，并通过控制其角度拼接成一个完整的圆，再通过动态控制所有扇形的半径由小到大不断循环，以实现一个圆形(被分割成100份)不断扩散的效果。\r\n\r\n我尝试借鉴canvas离屏画布的方式，构建了离屏图层：\r\n1、在离屏图层上绘制图形；\r\n2、将图层转换成json(toJSON(optionsopt))；\r\n3、将该json赋予新图层((static) fromJSON(layerJSON))；\r\n4、将新图层添加到地图上；\r\n但似乎并没有效果，浏览器仍旧在大量调用API，导致性能问题；\r\n\r\n另一种方式是将扇形数量减少到20个左右，勉强流畅，但这样纯粹是逃避问题；\r\n\r\n所以想请教有没有更好的办法？\r\n离屏图层的方式是否具有可行性？\r\n\r\n\r\n**Please provide a reproduction URL (on any jsfiddle like site)**\r\n[----]\r\n[单个](https://jsfiddle.net/fjtjintang/pc8vuLn6/1/)\r\n[五个](https://jsfiddle.net/fjtjintang/3jgm18dq/17/)\r\n"}}
{"actor":{"display_login":"fuzhenn"}}