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/14 08:27:23 UTC

[GitHub] Mentiray opened a new issue #9751: geo切换底图后监听底图缩放问题

Mentiray opened a new issue #9751: geo切换底图后监听底图缩放问题
URL: https://github.com/apache/incubator-echarts/issues/9751
 
 
   var myChart = null;
   function showChart(xzqhdm){
   	if(myChart!=null){
   		myChart.dispose();
   	}
   	$.get('json/'+xzqhdm+'.json',function(DTJSON){
   		echarts.registerMap(xzqhdm,DTJSON);
   		var myChart = echarts.init(document.getElementById('demo'));
   		var option = {
   			geo:{
   				map : xzqhdm,
   				roam : true,
   			}
   		};
   		myChart.setOption(option);
   		myChart.on('geoRoam', function(){
   			console.log('监听到缩放操作');
   		});
   	});
   }
   //切换底图
   $('#button1').click(function(){
   	showChart('350000');
   })
   $('#button2').click(function(){
   	showChart('350100');
   })
   
   如果没有切换底图,一次缩放操作geoRoam就执行一次
   如果n次切换底图,一次缩放操作geoRoam就会执行n次这是为什么???

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