echarts-bot[bot] commented on issue #19990:
URL: https://github.com/apache/echarts/issues/19990#issuecomment-2139350370

   @guanzongjiang It seems you are not using English, I've helped translate the 
content automatically. To make your issue understood by more people and get 
helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Bug] The selected area echoes abnormally
   
   **BODY**
   
   ### Version
   
   5.5.0
   
   ### Link to Minimal Reproduction
   
   None at the moment, some geo data cannot be displayed.
   
   ### Steps to Reproduce
   
   I found a problem. I want to implement the map drill-down function. The code 
is implemented as follows. First, the default map data [map] is loaded, and 
then the click event is bound. When processing the click event, switch the map 
to map2, and then call goback to reset the options. When, the effect is not as 
expected
   
   var options = {
       tooltip: {},
       geo: {
           map: 'map',
           regions: [],
       },
       series:[
           {
               type: "map",
               geoIndex: 0,
               data: [],
           }
       ],
   };
   
   onMounted(async () => {
       mapData = ...;
       mapData2 = ...;
   
       mapDom = document.getElementById('map');
   
       myChart = echarts.init(mapDom);
       mapData = await util.getGeoData();
       echarts.registerMap("map", mapData);
       myChart.setOption(options);
       myChart.on('click', e => {
           echarts.registerMap("map2", mapData2);
           options.geo.map = "map2";
           myChart.setOption(options);
       })
   
   })
   
   function goback() {
       echarts.registerMap("map", mapData);
       options.geo.map = "map";
       myChart.setOption(options);
   }
   
   
   
   ### Current Behavior
   
   After goback is triggered, the following problems occur
   1. I found that the area I clicked for the first time was not selected, but 
when I moved the mouse over the area I clicked last time, it was selected 
again, and after leaving the area, the selected state will not disappear.
   2. Later I tried setting options and specified notMerge as true. When I 
returned to the previous step and repeated step 1, it would still not be 
selected, but it would not be selected when sliding over the selected area.
   3. When there is no series in options, the above situation will not occur, 
and the selected area will not be recorded.
   
   ### Expected Behavior
   
   1. When returning to the previous step, you can select the area clicked last 
time.
   
   ### Environment
   
   ```markdown
   - OS:
   -Browser:
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_
   </details>


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