mzy2240 commented on issue #15256:
URL: https://github.com/apache/echarts/issues/15256#issuecomment-984324082


   @plainheart Sure.
   
   ```
   import * as echarts from "echarts/dist/echarts.min.js";
   import "../assets/echarts-extension-leaflet.esm.js";
   
   let chart = echarts.init(document.getElementById("main"), "dark");
   chart.setOption(echartsOptions);
   ```
   For the echartsOptions, I have fields for leaflet and series, all the 
coordinateSystem are leaflet already. Here is a snippet of the options I am 
using:
   
   ```
   echartsOptions = {
           leaflet: {
             // leaflet options (only primitive options, 
crs/layers/renderer/maxBounds are not allowed here)
             center: this.mapCenter,
             zoom: 8,
             maxZoom: 18,
             // maxBoundsViscosity: 1.0,
             // zoomAnimation: false,
   
             // the following options are from this plugin
             // whether the chart should always re-render when moving/zooming 
the map
             renderOnMoving: true,
             // whether to enable large mode (it's better to enable when data 
is large)
             largeMode: false,
           },
           animation: false,
           tooltip: {
             show: true,
             trigger: "item",
           },
           series: [
             {
               id: "sub",
               type: "effectScatter",
               name: "sub",
               coordinateSystem: "leaflet",
               // coordinateSystem: 'bmap',
               symbol: "circle",
               symbolSize: function (value, params) {
                 if (params.data.attributes.Gen) {
                   return 14;
                 } else if (params.data.attributes.Shunt) {
                   return 12;
                 } else {
                   return 10;
                 }
               },
               showEffectOn: "emphasis",
               zlelve: 5,
               z: 5,
               // progressive: 40,
               // progressiveThreshold: 200,
               // zindex: 2,
               data: [],
               tooltip: {
                 confine: true,
                 formatter: function (params) {
                   return "Substation: " + params.name;
                 },
               },
   ...
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to