eapatel opened a new issue #15256:
URL: https://github.com/apache/echarts/issues/15256


   ### What problem does this feature solve?
   I'm using echarts-leaflet extension in my project. I want to set bounds and 
making map bounce back if moved away. I can get _map through 
this.echart.getModel().getComponent('leaflet').__map, but how can I get L and 
how to setMaxBounds() ?
   
   ### What does the proposed API look like?
   I can set bounds using Leaflet library by using below code :
   
   `const southWest = Leaflet.latLng(-89.98155760646617, -180),`
   `northEast = Leaflet.latLng(89.99346179538875, 180);`
   `const bounds = Leaflet.latLngBounds(southWest, northEast);`
   `map.setMaxBounds(bounds);`
   
   How can I achieve the same thing using 'echarts-leaflet'? 
   
   I tried using below code with echarts-leaflet extension but it's not working.
       this.option = {
           leaflet: {
           roam: true,
           maxBounds: [[-89.98155760646617, -180],[89.99346179538875, 180]],
           maxBoundsViscosity: 1,
           center: [4.9,-1.766667],
           zoom: 2,
           tiles: [{
               urlTemplate: 'assets/{z}/{x}/{y}.jpg',
               options: {
                   minZoom: 2,
                   maxZoom: 6,
                   attribution: ''
                }
            }]
         }
   
   Thanks in advance for any help.
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
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