echart 地图 地图上的点 静态markPoint,动态markPoint

30 篇文章 0 订阅
 	myChart = echarts.init(document.getElementById('mainChart'));
        var option;
        option = {
        	    title : {
        	        text: '全国主要城市空气质量(pm2.5)',
        	        subtext: 'data from PM25.in',
        	        sublink: 'http://www.pm25.in',
        	        x:'center'
        	    },
        	    tooltip : {
        	        trigger: 'item'
        	    },
        	    legend: {
        	        orient: 'vertical',
        	        x:'left',
        	        data:['pm2.5']
        	    },
        	    dataRange: {
        	        min : 0,
        	        max : 500,
        	        calculable : true,
        	        color: ['maroon','purple','red','orange','yellow','lightgreen']
        	    },
        	    toolbox: {
        	        show : true,
        	        orient : 'vertical',
        	        x: 'right',
        	        y: 'center',
        	        feature : {
        	            mark : {show: true},
        	            dataView : {show: true, readOnly: false},
        	            restore : {show: true},
        	            saveAsImage : {show: true}
        	        }
        	    },
        	    series : [
        	        {
        	            name: 'pm2.5',
        	            type: 'map',
        	            mapType: 'china',
        	            hoverable: false,
        	            roam:true,
        	            data : [],
        	            markPoint : {//数据全是markPoint
        	                symbolSize: 20,       // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
        	                itemStyle: {
        	                    normal: {
        	                        borderColor: '#87cefa',
        	                        borderWidth: 1,            // 标注边线线宽,单位px,默认为1
        	                        label: {
        	                            show: false
        	                        }
        	                    },
        	                    emphasis: {
        	                        borderColor: '#1e90ff',
        	                        borderWidth: 5,
        	                        label: {
        	                            show: false
        	                        }
        	                    }
        	                },
        	                effect : {
        	                    show: true,
        	                    shadowBlur : 0
        	                },
        	                data : [
        	                    {name: "海门", value: 9},
        	                    {name: "鄂尔多斯", value: 12},
        	                ],
```````````````````````````````geoCoord: {
                ```````````````"海门":[121.15,31.89],
                ````````````````"鄂尔多斯":[109.781327,39.608266]
                               }
        	            },//end markPoint
        	           
        	        }//end series[0],
        	        ,
        	        {
        	            name: 'top5',
        	            type: 'map',
        	            mapType: 'china',
        	            hoverable: false,
        	            roam:true,
        	            data : [],
        	            markPoint : {//数据全是markPoint
        	                symbolSize: 20,       // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
        	                itemStyle: {
        	                    normal: {
        	                        borderColor: '#1e90ff',
        	                        borderWidth: 1,            // 标注边线线宽,单位px,默认为1
        	                        label: {
        	                            show: false
        	                        }
        	                    },
        	                    emphasis: {
        	                        borderColor: '#1e90ff',
        	                        borderWidth: 5,
        	                        label: {
        	                            show: false
        	                        }
        	                    }
        	                },
        	                effect : {
        	                    show: true,
        	                    shadowBlur : 0
        	                },
        	                data : [
        	                    {name: "海门", value: 9},
        	                    {name: "鄂尔多斯", value: 12},
        	                ]
        	            },//end markPoint
        	           
        	        }//end series[0]
        	    ]
      
        	};
        	    
        	                    
    	myChart.setOption(option);
        

注意:geoCoord可放在series里的任意位置,只要有一个就好

1.动态闪点,由markPoint的以下语句实现:

 effect : {
                           show: true,
                           shadowBlur : 0
                       },

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值