未验证 提交 381b21eb 编写于 作者: Y Yi Shen 提交者: GitHub

Merge pull request #12411 from apache/improve-bmap

fix(bmap): fix bmap style changed by the sdk and cause unexpected refresh bug
......@@ -18,6 +18,7 @@
*/
import * as echarts from 'echarts';
import { clone } from 'zrender/src/core/util';
export default echarts.extendComponentView({
type: 'bmap',
......@@ -96,7 +97,7 @@ export default echarts.extendComponentView({
if (JSON.stringify(originalStyle) !== mapStyleStr) {
// FIXME May have blank tile when dragging if setMapStyle
if (Object.keys(newMapStyle).length) {
bmap.setMapStyle(newMapStyle);
bmap.setMapStyle(clone(newMapStyle));
}
bMapModel.__mapStyle = JSON.parse(mapStyleStr);
}
......@@ -110,7 +111,7 @@ export default echarts.extendComponentView({
if (JSON.stringify(originalStyle2) !== mapStyleStr2) {
// FIXME May have blank tile when dragging if setMapStyle
if (Object.keys(newMapStyle2).length) {
bmap.setMapStyleV2(newMapStyle2);
bmap.setMapStyleV2(clone(newMapStyle2));
}
bMapModel.__mapStyle2 = JSON.parse(mapStyleStr2);
}
......
......@@ -123,9 +123,13 @@ lineDrawProto.incrementalPrepareUpdate = function (lineData) {
this.group.removeAll();
};
function isEffectObject(el) {
return el.animators && el.animators.length > 0;
}
lineDrawProto.incrementalUpdate = function (taskParams, lineData) {
function updateIncrementalAndHover(el) {
if (!el.isGroup) {
if (!el.isGroup && !isEffectObject(el)) {
el.incremental = el.useHoverLayer = true;
}
}
......
......@@ -24,7 +24,7 @@ under the License.
<script src='lib/esl.js'></script>
<script src='lib/config.js'></script>
<script src='lib/jquery.min.js'></script>
<script src='http://api.map.baidu.com/api?v=2.0&ak=KOmVjPVUAey1G2E8zNhPiuQ6QiEmAwZu'></script>
<script src='http://api.map.baidu.com/api?v=3.0&ak=KOmVjPVUAey1G2E8zNhPiuQ6QiEmAwZu'></script>
<meta name='viewport' content='width=device-width, initial-scale=1' />
</head>
<body>
......@@ -34,8 +34,14 @@ under the License.
height: 100%;
margin: 0;
}
#clear {
position: absolute;
left: 10px;
top: 10px;
}
</style>
<div id='main'></div>
<button id='clear'>Clear</button>
<script>
require([
......@@ -244,8 +250,15 @@ under the License.
});
});
});
document.getElementById('clear').addEventListener('click', function() {
myChart.setOption({
series: [{
data: []
}]
});
});
});
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册