解决方法:先给ehcarts赋值高宽,再隐藏。
js
$("#map").css({"width":$("#map").width(),"height":$("#map").height()}); //隐藏之前先设置高、宽,防止出现100px
document.getElementById("mapDiv").style.display= "none";
示echarts时再重新赋值高宽:
$("#map").css({"width":$("#map").width(),"height":$("#map").height()});
var optionMap = { //在optionMap 之前赋值宽高