echarts中国地图 飞线 热力

echarts中国地图 飞线 热力template divstyle width 100 height 100 padding 5px10px divid map style width 788px height 700px divid map style width 788px height 700px divstyle width 100 height 100 padding 5px10px template script importaxiosf axios importchinaf script

<template> <div style="width: 100%; height: 100%; padding: 5px 10px"> <div id="map" style="width: 788px; height: 700px"></div> </div> </template> <script> import axios from "axios"; import china from "../../utils/china.json"; export default { 
    props: [], data() { 
    return { 
    hotData: [], fromData: [], }; }, methods: { 
    getStatisticsClientType() { 
    let that = this; axios .post( "https://avamayun.xingbiaoyi.com/overviewScreen/statisticsRegionScanCode" ) .then(function (res) { 
    that.hotData = [ { 
    log: 121.07299, scanCount: 1526, region: "南通市", lat: 32.06764, }, { 
    log: 120., scanCount: 1167, region: "上海市", lat: 24., }, { 
    log: 118.85578, scanCount: 26, region: "红河哈尼族彝族自治州", lat: 31.79811, }, { 
    log: 113.33685, scanCount: 23, region: "广州市", lat: 23.13491, }, { 
    log: 103.83845, scanCount: 16, region: "兰州市", lat: 36.0766, }, { 
    log: 113.06644, scanCount: 7, region: "长沙市", lat: 28.25761, }, ]; // that.hotData = res.data that.hotData.map((i) => { 
    i.name = i.region; i.value = [i.log, i.lat, i.scanCount]; // i.visualMap = false; }); that.initChart(); }) .catch(function (error) { 
    console.log(error); }); }, getInfo() { 
    let that = this; axios .post( "https://avamayun.xingbiaoyi.com/overviewScreen/scanCodeMigrationMap" ) .then(function (res) { 
    const arr = []; res.data.map((i) => { 
    arr.push([ { 
    coord: i.from.split(","), }, { 
    coord: i.to.split(","), }, ]); }); that.fromData = arr; that.initChart(); }) .catch(function (error) { 
    console.log(error); }); }, initChart() { 
    this.setOptions(); }, setOptions() { 
    let myChart = echarts.init(document.getElementById("map"), "macarons"); window.addEventListener("resize", () => { 
    myChart.resize(); }); echarts.registerMap("china", china); const option = { 
    visualMap: { 
    type: "continuous", min: 0, max: 12, splitNumber: 3, inRange: { 
    color: ["#dec674", "#ffc20e"], }, textStyle: { 
    color: "#fff", }, show: false, }, geo: { 
    map: "china", roam: true, center: [110.97, 35.71], layoutCenter: ["100%", "100%"], zoom: 1, // roam: true, //支持拖拽缩放 scaleLimit: { 
    //滚轮缩放的极限控制 min: 1, //缩放最小大小 max: 6, //缩放最大大小 }, label: { 
    normal: { 
    show: false, textStyle: { 
    color: "#fff", fontSize: 8, }, }, emphasis: { 
    show: true, textStyle: { 
    color: "#fff", }, }, }, itemStyle: { 
    areaColor: "rgba(0, 23, 58, 1)", borderColor: "rgba(85, 147, 193, 1)", borderWidth: 1, emphasis: { 
    borderWidth: 1, borderColor: "rgba(60,233,255,1)", areaColor: "rgba(0, 23, 58, 1)", }, }, }, // visualMap: { 
    // min: 0, // max: 1, // calculable: false, // realtime: false, // inRange: { 
    // color: [ // "#fcf16e", // "#dec674", // "#ffe600", // "#ffd400", // "#ffd400", // "#ffc20e", // ], // }, // }, series: [ { 
    type: "heatmap", coordinateSystem: "geo", data: this.hotData, color: [ "#fcf16e", "#dec674", "#ffe600", "#ffd400", "#ffd400", "#ffc20e", ], // symbolSize: function (val) { 
    // return val[2] * 1; // }, // itemStyle: { 
    // normal: { 
    // color: "#ddb926", // }, // }, }, { 
    type: "lines", zlevel: 2, effect: { 
    show: true, period: 4, //箭头指向速度,值越小速度越快 trailLength: 0.4, //特效尾迹长度[0,1]值越大,尾迹越长重 symbol: "circle", //箭头图标 symbolSize: 7, //图标大小 }, lineStyle: { 
    normal: { 
    color: "#FFB800", width: 0, //线条宽度 opacity: 0.1, //尾迹线条透明度 curveness: 0.2, //尾迹线条曲直度 }, }, data: this.fromData, }, ], }; myChart.setOption(option); }, }, created() { 
    this.getInfo(); this.getStatisticsClientType(); }, }; </script> <style lang="scss" scoped> </style> 
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/178710.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月26日 下午4:39
下一篇 2026年3月26日 下午4:40


相关推荐

  • Modbus 功能码解析

    Modbus 功能码解析Modbus 协议功能码详细解析

    2026年3月18日
    3
  • 二、快速开始——Spring集成Mybatis-Plus

    二、快速开始——Spring集成Mybatis-Plus由于MyBatis-Plus是在MyBatis的基础上只做增强不做改变,因此其与Spring的整合非常简单。只需把MyBatis的依赖换成MyBatis的依赖,再把sqlSessionFactory换成MyBatis-Plus的即可。下面让我们在Spring中快速集成Mybatis-Plus的具体操作:1、准备测试表–创建库CREATEDATABASEmp;–使用库USEm…

    2022年5月20日
    82
  • WINDOWS Platform SDK 下载[通俗易懂]

    WINDOWS Platform SDK 下载[通俗易懂]最近由于需要使用IPV6方面的开发资料,下载了WINDWOS网络编程相关的代码,发现在VC6.0上无法编译,猜想可能是SDK的版本较低,于是网上找来个:http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm 下载后,安装既可以实现IPV6在VC6.0平台编译调试。

    2022年5月4日
    76
  • 基于python的电影推荐系统_复仇者联盟4终局之战纸牌

    基于python的电影推荐系统_复仇者联盟4终局之战纸牌喜欢看电影的朋友都知道,五一节之前上映了一部漫威号称十年布局的超级大片,据说老一代的英雄们有很多就要退出历史的舞台了,今天我们不是聊这一部电影的内容怎样,情节怎样,而是想基于爬虫来对豆瓣和猫眼电影两个网站中的影评数据进行采集,之后有时间的话会基于采集到的数据来进行文本分析。好了,其他的话就不多说了,详细的代码实现在之前的文章里面也已经给出来了,这里简单贴一下爬取到的数据…

    2025年11月8日
    9
  • bs架构和cs架构的比对方法_cs架构嵌入BS

    bs架构和cs架构的比对方法_cs架构嵌入BS1、CS、BS架构定义  CS(Client/Server):客户端—-服务器结构。C/S结构在技术上很成熟,它的主要特点是交互性强、具有安全的存取模式、网络通信量低、响应速度快、利于处理大量数据。因为客户端要负责绝大多数的业务逻辑和UI展示,又称为胖客户端。它充分利用两端硬件,将任务分配到Client和Server两端,降低了系统的通讯开销。C/S结构的软件需要针对不同

    2022年10月16日
    8
  • task scheduler什么意思_女贞子的功效与作用

    task scheduler什么意思_女贞子的功效与作用前言本文隶属于专栏《1000个问题搞定大数据技术体系》,该专栏为笔者原创,引用请注明来源,不足和错误之处请在评论区帮忙指出,谢谢!本专栏目录结构和参考文献请见1000个问题搞定大数据技术体系正文TaskScheduler的核心任务是提交TaskSet到集群运算并汇报结果。(1)为TaskSet创建和维护一个TaskSetManager,并追踪任务的本地性以及错误信息。(2)遇到Straggle任务时,会放到其他节点进行重试。(3)向DAGScheduler

    2022年10月11日
    10

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号