<!DOCTYPE html>
<html lang="en">
<head><meta charset="utf-8"><title>ECharts</title><script src="js/esl.js"></script>
</head><body><div id="mainMap" style="height:800px;border:1px solid #ccc;padding:10px;"></div><span id="wrong-message" style="color:red">当前选择:浙江 </span><script type="text/javascript">require.config({paths:{ echarts:'./js/echarts','echarts/chart/map' : './js/echarts-map'}});require(['echarts','echarts/chart/map'],function(ec) {var myChart = ec.init(document.getElementById('mainMap'));myChart.setOption({tooltip : {trigger: 'item',formatter: '{b}'},series : [{name: '中国',type: 'map',mapType: 'china',selectedMode : 'multiple',itemStyle:{normal:{label:{show:true}},emphasis:{label:{show:true}}},data:[{name:'广东',selected:true}]}]});var ecConfig = require('echarts/config');myChart.on(ecConfig.EVENT.MAP_SELECTED, function (param) {var selected = param.selected;var str = '当前选择: ';for (var p in selected) {if (selected[p]) {str += p + ' ';}}document.getElementById('wrong-message').innerHTML = str;})});</script>
</body>
</html>