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

推荐订阅源

Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
H
Hacker News: Front Page
Stack Overflow Blog
Stack Overflow Blog
B
Blog
I
InfoQ
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
F
Full Disclosure
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
T
Tailwind CSS Blog
S
Secure Thoughts
P
Privacy International News Feed
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LINUX DO - 最新话题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
W
WeLiveSecurity
Google Online Security Blog
Google Online Security Blog
P
Privacy & Cybersecurity Law Blog
D
DataBreaches.Net
Engineering at Meta
Engineering at Meta
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
I
Intezer
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Project Zero
Project Zero
V2EX - 技术
V2EX - 技术
H
Heimdal Security Blog
博客园 - Franky
阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Troy Hunt's Blog
V
Vulnerabilities – Threatpost
H
Help Net Security
Martin Fowler
Martin Fowler
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
博客园 - 【当耐特】

博客园 - 鼓舞飞扬

点表格,某一列出现报错。 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);
        });
    },