About the use of ECHART2,ECHART3 maps a little bit of life experience:
1.echart3,echart2 load Map deformation repair.
Recently, when using ECHART2, it was found that loading a map of Hainan would produce deformation. For example, the map of Hainan has a large deformation, so we need to study how to eliminate the deformation. After a toss-up, modify the _gettransform function in the Echart-all.js
varxScale = width /mapWidth;varyScale = height / mapHeight;console.log(rate);if(xScale > yScale) { //xScale = yScale * rate; xScale = yScale; width = mapWidth * xScale;}else{ yScale = xScale; //xScale = yScale * rate; height = mapHeight * yScale;}
So the map can not be deformed (echart3 add this aspectscale:1 can make the map does not deform)
Add Custom Geosjon in 2.echart2 (mainly Echart2,echart3 Geojson is more convenient)
Also modify the Echart-all.js code to add the following code, you can use Maptype as ' Hainan ' map
‘hainan‘: {getGeoJson: (function() { return function(callback) {$.getJSON(‘data/hn.geojson‘,callback);} })()},
Echarts Map usage Experience-map warp and add data