diff --git a/src/component/helper/MapDraw.js b/src/component/helper/MapDraw.js index fa0fd0b867417a5bd2a56b5ce7a64ef427222900..1aa8ba825745653fc28b92bc2e7e488b7d3fc4c9 100644 --- a/src/component/helper/MapDraw.js +++ b/src/component/helper/MapDraw.js @@ -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'); diff --git a/src/util/graphic.js b/src/util/graphic.js index 9ba7adf1f0d06437702bf6edf71155d73024b518..ea9cb093677e9ecd362578d597c9f8bad02e904a 100644 --- a/src/util/graphic.js +++ b/src/util/graphic.js @@ -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');