text: function index_body_map_init(){infoMapInitial()}function infoMapInitial(){fieldInstances.length=0;const a=L.tileLayer.chinaProvider("TianDiTu.Normal.Map",{maxZoom:20,minZoom:5}),g=L.tileLayer.chinaProvider("TianDiTu.Normal.Annotion",{maxZoom:20,minZoom:5}),j=L.tileLayer.chinaProvider("TianDiTu.Satellite.Map",{maxZoom:20,minZoom:5}),c=L.tileLayer.chinaProvider("TianDiTu.Satellite.Annotion",{maxZoom:20,minZoom:5});const h=L.layerGroup([a,g]),d=L.layerGroup([j,c]);const k={"天地图":d},e={};const l=[40.433294,109.595275];const f=[40.435071,109.607786];const b=L.map("themeMap",{center:f,zoom:15,layers:[d],zoomControl:false});L.control.layers(k,e).addTo(b);L.control.zoom({zoomInTitle:"放大",zoomOutTitle:"缩小"}).addTo(b);let options={data:{dataPoint1:Math.random()*20,dataPoint2:Math.random()*20,dataPoint3:Math.random()*20,dataPoint4:Math.random()*20},chartOptions:{dataPoint1:{fillColor:"#FEE5D9",minValue:0,maxValue:20,maxHeight:20,displayText:function(m){return m.toFixed(2)}},dataPoint2:{fillColor:"#FCAE91",minValue:0,maxValue:20,maxHeight:20,displayText:function(m){return m.toFixed(2)}},dataPoint3:{fillColor:"#FB6A4A",minValue:0,maxValue:20,maxHeight:20,displayText:function(m){return m.toFixed(2)}},dataPoint4:{fillColor:"#CB181D",minValue:0,maxValue:20,maxHeight:20,displayText:function(m){return m.toFixed(2)}}},weight:1,color:"#000000"};let barChartMarker=new L.BarChartMarker(new L.LatLng(40.435071,109.607786),options);b.addLayer(barChartMarker);infoDrawField(l,b);timeLine(b)}function infoDrawField(a,b){for(let i=0;i<fields.length;i++){fieldInstances.push(infoFieldOutline(fields[i],a,b))}}function infoFieldOutline(b,a,c){let field=[];for(let i=0;i<b.length;i++){let group=[];let block=b[i][0];block.push(a);group.push(drawMyPolygon(block,c));let block0=b[i][0];let block1=b[i][1];group.push(drawMyPolygon(block1.concat(block0.reverse()),c));let block3=b[i][1];console.log("block3: "+block3);let block2=b[i][2];console.log("block2: "+block2);group.push(drawMyPolygon(block2.concat(block3.reverse()),c));field.push(group)}return field}function drawMyPolygon(b,a){return L.polygon(b,{weight:2,opacity:1,fillOpacity:0.7}).addTo(a)}function calculateColor(a){let calculator=new L.HSLHueFunction(new L.Point(30,120),new L.Point(60,0));let colors=[];for(let i=0;i<a.length;i++){colors.push(calculator.evaluate(a[i]))}return colors}function timeLine(a){let items=[177,185,189,193,198,202,207,214,221,234];let timeItems=[];for(let i=0;i<items.length;i++){timeItems.push(String(items[i])+"天")}L.control.timelineSlider({timelineItems:timeItems,changeMap:changeMapListener}).addTo(a)}changeMapListener=function(a){let choice=a.label.substring(0,a.label.length-1);let chartData=getChartDataByCache("corn/cornHeightAndChloDOY",JSON.stringify({DOY:choice}));let props=extractCol(chartData,"chlorophyll");let colors=calculateColor(props);for(let i=0;i<colors.length;i++){let fieldId=Math.floor(i/9);let tmp=i-fieldId*9;let groupId=Math.floor(tmp/3);let blockId=tmp%3;fieldInstances[fieldId][groupId][blockId].setStyle({color:colors[i],fillColor:colors[i]}).bindPopup("Chlo: "+props[i])}};