提交 bb928009 编写于 作者: L lang

Optimize MapDraw with compoundPath

上级 10e31b93
......@@ -128,6 +128,12 @@ define(function (require) {
zrUtil.each(geo.regions, function (region) {
var regionGroup = new graphic.Group();
var compoundPath = new graphic.CompoundPath({
shape: {
paths: []
}
});
regionGroup.add(compoundPath);
var dataIdx;
// Use the itemStyle in data if has data
if (data) {
......@@ -162,18 +168,15 @@ define(function (require) {
var polygon = new graphic.Polygon({
shape: {
points: contour
},
style: {
strokeNoScale: true
},
culling: true
}
});
polygon.setStyle(itemStyle);
regionGroup.add(polygon);
compoundPath.shape.paths.push(polygon);
});
compoundPath.setStyle(itemStyle);
compoundPath.style.strokeNoScale = true;
compoundPath.culling = true;
// Label
var showLabel = labelModel.get('show');
var hoverShowLabel = hoverLabelModel.get('show');
......
......@@ -38,6 +38,8 @@ define(function(require) {
graphic.Arc = require('zrender/graphic/shape/Arc');
graphic.CompoundPath = require('zrender/graphic/CompoundPath');
graphic.LinearGradient = require('zrender/graphic/LinearGradient');
graphic.RadialGradient = require('zrender/graphic/RadialGradient');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册