From e231c0968be5f654af8fccc29176497564433aaa Mon Sep 17 00:00:00 2001 From: Ovilia <zwl.sjtu@gmail.com> Date: Mon, 9 Dec 2024 17:03:33 +0800 Subject: [PATCH] fix(map): update test cases --- test/effectScatter.html | 30 +++++++++++++++--------------- test/map-projection.html | 29 ++++++++++++++++++++++++----- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/test/effectScatter.html b/test/effectScatter.html index a05161764c..990d2dd469 100644 --- a/test/effectScatter.html +++ b/test/effectScatter.html @@ -564,21 +564,21 @@ ] }); - // setInterval(function () { - // var rippleEffectCount = ~~(Math.random() * 9) + 1; - // // console.log('rippleEffectCount', rippleEffectCount); - // myChart.setOption({ - // series: [{ - // name: 'Top 5', - // data: convertData(data.sort(function (a, b) { - // return b.value - a.value; - // }).slice(0, Math.round(6 * Math.random()))), - // rippleEffect: { - // count: rippleEffectCount - // } - // }] - // }); - // }, 2000); + setInterval(function () { + var rippleEffectCount = ~~(Math.random() * 9) + 1; + // console.log('rippleEffectCount', rippleEffectCount); + myChart.setOption({ + series: [{ + name: 'Top 5', + data: convertData(data.sort(function (a, b) { + return b.value - a.value; + }).slice(0, Math.round(6 * Math.random()))), + rippleEffect: { + count: rippleEffectCount + } + }] + }); + }, 2000); }); diff --git a/test/map-projection.html b/test/map-projection.html index 667b06e865..5bef5b50e2 100644 --- a/test/map-projection.html +++ b/test/map-projection.html @@ -48,11 +48,24 @@ <script> require([ 'echarts', - 'map/json/china-new.json' - ], function (echarts, chinaJson) { - echarts.registerMap('china', chinaJson) - + 'map/js/china.js' + ], function (echarts) { option = { + title: [{ + text: '地图数据来源:天地图 cloudcenter.tianditu.gov.cn', + subtext: '仅作为功能测试使用,线上产品应从天地图获取最新地图数据并申请审图号', + link: 'https://cloudcenter.tianditu.gov.cn/', + bottom: 15, + left: 15, + textStyle: { + color: '#888', + fontSize: 12 + }, + subtextStyle: { + color: '#aaa', + fontSize: 12 + } + }], series: { type: 'map', map: 'china', @@ -63,7 +76,13 @@ projection: { project: (point) => [point[0] / 180 * Math.PI, -Math.log(Math.tan((Math.PI / 2 + point[1] / 180 * Math.PI) / 2))], unproject: (point) => [point[0] * 180 / Math.PI, 2 * 180 / Math.PI * Math.atan(Math.exp(point[1])) - 90] - } + }, + regions: [{ + name: '新疆维吾尔自治区附近境界线', + itemStyle: { + borderColor: '#404a59' + } + }] } };