地图切换echarts 地图配置项内容和展示

两种及以上地图切换

配置项如下
      var locations = [{
name: 'china'
}, {
name: 'world'
}];
option = {
    title: {
	         x:'center',
	         text:'世界地图',
	         textStyle: {
	             color: '#000',
	             fontSize: 16
	         }
	},
    tooltip: {
        trigger: 'item',
        formatter: '{b}'
    },
    series: [
        {
           
            type: 'map',
            mapType: 'world',
            selectedMode : 'multiple',
            label: {
                normal: {
                    show: true
                },
                emphasis: {
                    show: true
                }
            },
            data:[
            ]
        }
    ]
};
var curIndx = 0;
app.timeTicket = setInterval(function () {
     myChart.setOption({
        title: {
	         x:'center',
	         text:locations[curIndx].name+'地图',
	         textStyle: {
	             color: '#000',
	             fontSize: 16
	         }
	    },
	    series : [
		     {
				type: 'map',
				mapType: locations[curIndx].name
		     }
		]
     })
    curIndx++;
    curIndx=curIndx%locations.length;
}, 2000);
    
截图如下