提交 c10773fa 编写于 作者: C chengjie

Feature - support version 3.0 (bmap)

Expanding echart to support version 3.0 (bmap) of Baidu Map API.
上级 4e4cf884
......@@ -49,6 +49,8 @@ export default echarts.extendComponentModel({
mapStyle: {},
mapStyleV2: {},
roam: false
}
});
\ No newline at end of file
......@@ -87,6 +87,7 @@ export default echarts.extendComponentView({
bmap.disablePinchToZoom();
}
/* map 2.0 */
var originalStyle = bMapModel.__mapStyle;
var newMapStyle = bMapModel.get('mapStyle') || {};
......@@ -100,6 +101,20 @@ export default echarts.extendComponentView({
bMapModel.__mapStyle = JSON.parse(mapStyleStr);
}
/* map 3.0 */
var originalStyle2 = bMapModel.__mapStyle2;
var newMapStyle2 = bMapModel.get('mapStyleV2') || {};
// FIXME, Not use JSON methods
var mapStyleStr2 = JSON.stringify(newMapStyle2);
if (JSON.stringify(originalStyle2) !== mapStyleStr2) {
// FIXME May have blank tile when dragging if setMapStyle
if (Object.keys(newMapStyle2).length) {
bmap.setMapStyleV2(newMapStyle2);
}
bMapModel.__mapStyle2 = JSON.parse(mapStyleStr2);
}
rendering = false;
}
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册