惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
V
Vulnerabilities – Threatpost
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Privacy International News Feed
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
MyScale Blog
MyScale Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
L
LINUX DO - 最新话题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Cloudflare Blog
美团技术团队
Recorded Future
Recorded Future
T
Tailwind CSS Blog
Latest news
Latest news
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
Know Your Adversary
Know Your Adversary
Cloudbric
Cloudbric
Schneier on Security
Schneier on Security
I
Intezer
L
LINUX DO - 热门话题
P
Palo Alto Networks Blog
云风的 BLOG
云风的 BLOG
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
L
LangChain Blog
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
L
Lohrmann on Cybersecurity
S
SegmentFault 最新的问题
W
WeLiveSecurity
C
Cybersecurity and Infrastructure Security Agency CISA
S
Securelist
SecWiki News
SecWiki News
V2EX - 技术
V2EX - 技术
IT之家
IT之家
Cyberwarzone
Cyberwarzone
F
Full Disclosure
Spread Privacy
Spread Privacy
阮一峰的网络日志
阮一峰的网络日志

博客园 - 鼓舞飞扬

点表格,某一列出现报错。 qiankun使用关键代码 tinymce富文本编辑器使用 在vue项目中取消axios请求(单个和全局) JavaScript中的export、export default、exports和module.exports(export、export default、exports使用详细) 前端经典面试题 白屏优化 全网首发黑马程序员鸿蒙 HarmonyOS NEXT星河版零基础入门到实战,零基础也能快速入门鸿蒙开发教程 vue 图片资源应该如何存放并引入(public、assets)? 自定义树形模糊搜索 mapbox聚合使用自定义图标 Mapbox添加多个不同的点图标 mapbox gl 标注无法显示 报错 Error {message: ‘Unimplemented type: 4‘} mapbox加载图片类型图标 mapbox大数据展示 The engine “node“ is incompatible with this module.解决方法 配置镜像 【NPM报错】Node Sass does not yet support your current environment Turf.js简介
取消上次ajax
鼓舞飞扬 · 2024-09-13 · via 博客园 - 鼓舞飞扬
// 大数据展示
    async queryBigData() {
      this.cancel && this.cancel();
      const CancelToken = axios.CancelToken;
      this.isLoad = true;
      this.ajaxBasicFinished = false;
      if (this.pointLayer) {
        this.scene.removeLayer(this.pointLayer);
      };
      this.scene.removeImage('lmapostIcon');
      let image = new Image(40, 40);
      image.src = `${this.$__webpack_public_path__}/static/images/map/${this.objectName}.svg`;
      await this.scene.addImage('lmapostIcon', image);

      const data = {
        Token: 'fdasfn8934r5nt9785o43mo#4K9',
        Belong: this.deviceBelong,
        ObjectName: this.objectName,
        Ucs: 'WGS84',
      };
      const options = {
        method: "POST",
        headers: { "content-type": "application/json" },
        data: data,
        url: `${BASE_CONFIG.BASE_API3}/get`,
        cancelToken: new CancelToken(c => {
          this.cancel = c;
        }),
      };
      axios(options)
        .then((response) => {
          let data = response.data.data;
          if(data && data.length > 0) {
            let geojson = {
              type: 'FeatureCollection',
              features: []
            };
            for (let i = 0; i < data.length; i++) {
              let item = data[i];
              // 上万条数据
              let feature = {
                  type: 'feature',
                  geometry: {
                      type: 'Point',
                      coordinates: []
                  },
                  properties: {
                    name: item.ObjectName
                  }
              };
              let longreg = /^(\-|\+)?(((\d|[1-9]\d|1[0-7]\d|0{1,3})\.\d{0,6})|(\d|[1-9]\d|1[0-7]\d|0{1,3})|180\.0{0,6}|180)$/;
              let latreg = /^(\-|\+)?([0-8]?\d{1}\.\d{0,6}|90\.0{0,6}|[0-8]?\d{1}|90)$/;
              let flag1 = longreg.test( this.decimalProcess(item.lnglat[0]) );
              let flag2 = latreg.test( this.decimalProcess(item.lnglat[1]) );

              if(flag1 && flag2){
                feature.geometry.coordinates = [this.decimalProcess(item.lnglat[0]), this.decimalProcess(item.lnglat[1])];
                geojson.features.push(feature);
              }
            };

            let bbox = this.$turf.bbox(geojson);
            this.scene.fitBounds(bbox);
            this.isLoad = false;
            this.pointLayer = new PointLayer({
              blend: 'normal',
              zIndex: 111
            })
              .source(geojson)
              .shape('lmapostIcon')
              .size(15)
            this.scene.addLayer(this.pointLayer);
            this.isNoData = false;
            this.ajaxBasicFinished = true;
          } else {
            this.isLoad = false;
            this.ajaxBasicFinished = true;
            this.isNoData = true;
            this.$message({
              message: '暂无设备',
              type: "warning",
            });
          }
        })
        .catch(error => {
          this.isLoad = false;
          console.log(error);
        });
    },