未验证 提交 00f2c32c 编写于 作者: Y Yi Shen 提交者: GitHub

Merge pull request #12868 from plainheart/feat-add-initial-option-for-bmap

feat(extension/bmap): support for specifying initial map options.
...@@ -179,7 +179,12 @@ BMapCoordSys.create = function (ecModel, api) { ...@@ -179,7 +179,12 @@ BMapCoordSys.create = function (ecModel, api) {
// Not support IE8 // Not support IE8
bmapRoot.classList.add('ec-extension-bmap'); bmapRoot.classList.add('ec-extension-bmap');
root.appendChild(bmapRoot); root.appendChild(bmapRoot);
var bmap = bmapModel.__bmap = new BMap.Map(bmapRoot);
// initialize bmap
var mapOptions = bmapModel.get('mapOptions') || {};
// Not support `mapType`, use `bmap.setMapType(MapType)` instead.
delete mapOptions.mapType;
var bmap = bmapModel.__bmap = new BMap.Map(bmapRoot, mapOptions);
var overlay = new Overlay(viewportRoot); var overlay = new Overlay(viewportRoot);
bmap.addOverlay(overlay); bmap.addOverlay(overlay);
...@@ -215,4 +220,4 @@ BMapCoordSys.create = function (ecModel, api) { ...@@ -215,4 +220,4 @@ BMapCoordSys.create = function (ecModel, api) {
}); });
}; };
export default BMapCoordSys; export default BMapCoordSys;
\ No newline at end of file
...@@ -47,10 +47,15 @@ export default echarts.extendComponentModel({ ...@@ -47,10 +47,15 @@ export default echarts.extendComponentModel({
zoom: 5, zoom: 5,
// 2.0 http://lbsyun.baidu.com/custom/index.htm
mapStyle: {}, mapStyle: {},
// 3.0 http://lbsyun.baidu.com/index.php?title=open/custom
mapStyleV2: {}, mapStyleV2: {},
// See https://lbsyun.baidu.com/cms/jsapi/reference/jsapi_reference.html#a0b1
mapOptions: {},
roam: false roam: false
} }
}); });
\ No newline at end of file
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册