echarts 修改地图经纬度
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                echarts 修改地图经纬度
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                
                            
                            
                            // 修改市中心經緯度
editMapCp(){var chinaEchartsObj = this.$echarts.getMap('廣東');var geoJSONChina = chinaEchartsObj.geoJson;var allDefProvince = geoJSONChina.features;for(var i=0,len=allDefProvince.length; i<len; i++){var sglProvinceProperties = allDefProvince[i].properties;var sglProvinceName = sglProvinceProperties.name;switch(sglProvinceName){case '河源市':sglProvinceProperties.cp[0]=114.967484;sglProvinceProperties.cp[1]=23.765958;break;case '汕尾市':sglProvinceProperties.cp[0]=115.527613;sglProvinceProperties.cp[1]=23.002469;break;case '潮州市':sglProvinceProperties.cp[0]=116.762406;sglProvinceProperties.cp[1]=23.805144;break;case '汕頭市':sglProvinceProperties.cp[0]=116.607214;sglProvinceProperties.cp[1]=23.323404;break;case '揭陽市':sglProvinceProperties.cp[0]=116.0185;sglProvinceProperties.cp[1]=23.442287;break;case '清遠市':sglProvinceProperties.cp[0]=113.13368;sglProvinceProperties.cp[1]=24.254554;break;case '廣州市':sglProvinceProperties.cp[0]=113.43368;sglProvinceProperties.cp[1]=23.376234;break;case '惠州市':sglProvinceProperties.cp[0]=114.537518;sglProvinceProperties.cp[1]=23.13637;break;case '東莞市':sglProvinceProperties.cp[0]=113.810825;sglProvinceProperties.cp[1]=22.983145;break;case '深圳市':sglProvinceProperties.cp[0]=114.270757;sglProvinceProperties.cp[1]=22.63738;break;case '肇慶市':sglProvinceProperties.cp[0]=112.234442;sglProvinceProperties.cp[1]=23.463922;break;case '江門市':sglProvinceProperties.cp[0]=112.601344;sglProvinceProperties.cp[1]=22.373689;break;case '云浮市':sglProvinceProperties.cp[0]=111.815903;sglProvinceProperties.cp[1]=22.776636;break;case '陽江市':sglProvinceProperties.cp[0]=111.815903;sglProvinceProperties.cp[1]=21.960395;break;case '茂名市':sglProvinceProperties.cp[0]=110.927049;sglProvinceProperties.cp[1]=21.862768;break;}}this.$echarts.registerMap('廣東', geoJSONChina, {});} 
                        
                        
                        執行editMapCp再執行地圖渲染方法。
總結
以上是生活随笔為你收集整理的echarts 修改地图经纬度的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: NoSQL 中的 CAP
- 下一篇: 使用Windows自带的录音机进行wav
