diff --git a/extension-src/bmap/BMapCoordSys.js b/extension-src/bmap/BMapCoordSys.js index 2bd8070d12..30a05ef024 100644 --- a/extension-src/bmap/BMapCoordSys.js +++ b/extension-src/bmap/BMapCoordSys.js @@ -179,7 +179,12 @@ BMapCoordSys.create = function (ecModel, api) { // Not support IE8 bmapRoot.classList.add('ec-extension-bmap'); 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); bmap.addOverlay(overlay); @@ -215,4 +220,4 @@ BMapCoordSys.create = function (ecModel, api) { }); }; -export default BMapCoordSys; \ No newline at end of file +export default BMapCoordSys; diff --git a/extension-src/bmap/BMapModel.js b/extension-src/bmap/BMapModel.js index ca5cb6525a..5f0d4d6b1c 100644 --- a/extension-src/bmap/BMapModel.js +++ b/extension-src/bmap/BMapModel.js @@ -47,10 +47,15 @@ export default echarts.extendComponentModel({ zoom: 5, + // 2.0 http://lbsyun.baidu.com/custom/index.htm mapStyle: {}, + // 3.0 http://lbsyun.baidu.com/index.php?title=open/custom mapStyleV2: {}, + // See https://lbsyun.baidu.com/cms/jsapi/reference/jsapi_reference.html#a0b1 + mapOptions: {}, + roam: false } -}); \ No newline at end of file +}); diff --git a/test/bmap-mapOptions.html b/test/bmap-mapOptions.html new file mode 100644 index 0000000000..8df0c1c4d7 --- /dev/null +++ b/test/bmap-mapOptions.html @@ -0,0 +1,530 @@ + + + + + + + + + + + + + + +
+ + +