You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/01/28 08:38:35 UTC

[GitHub] plainheart commented on issue #9837: bmap是否有mapstyleV2这个属性

plainheart commented on issue #9837: bmap是否有mapstyleV2这个属性
URL: https://github.com/apache/incubator-echarts/issues/9837#issuecomment-458039690
 
 
   `mapStyleV2` is not supported for current version of echarts bmap extension. But you can modify the source code below the folder `/extension/bmap/` for your custom requirements. 
   Demo:
   `/extension/bmap/BMapModel.js`
   ```
   ...
   defaultOption: {
       center: [104.114129, 37.550339],
       zoom: 5,
       mapStyle: {},
       roam: false,
       enableV2: false // ADDED
   }
   ...
   ```
   `/extension/bmap/BMapView.js`
   ```
   ...
   var newMapStyle = bMapModel.get('mapStyle') || {}; // FIXME, Not use JSON methods
   var enableV2 = bMapModel.get('enableV2') || false; // Enable setMapStyleV2 or not
   
   var mapStyleStr = JSON.stringify(newMapStyle);
   
   if (JSON.stringify(originalStyle) !== mapStyleStr) {
       // FIXME May have blank tile when dragging if setMapStyle
       if (Object.keys(newMapStyle).length) {
           enableV2 ? bmap.setMapStyleV2(newMapStyle) : bmap.setMapStyle(newMapStyle); // MODIFIED
       }
       ...
   }
   ...
   ```
   Then configure the option:
   ```
   option = {
       bmap: {
           center: [120.13066322374, 30.240018034923],
           zoom: 14,
           roam: true,
           mapStyle: {},
           enableV2: true // CUSTOM
       },
       series: [{
           type: 'scatter',
           coordinateSystem: 'bmap',
           data: [ [120, 30, 1] ]
       }]
   }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org