zoukankan      html  css  js  c++  java
  • maptalks 开发GIS地图(17)maptalks.three.10

    1. Boxes   我特意查了一下,Box 的复数是 Boxes,不是Box,threelayer的官方demo里写的是boxs,对象名称

    写的也是 threeLayer.toBoxs , 所以,我只在这篇文章里修改了这个复数形式,代码里面没有修改。

    2. Boxs 从形式上看是 Box 的复数,指的是有很多Box,从数据上看,也是比 Box 好了很多。Boxs 使用的

    数据量为 30508个,Box 示例的数据量是 2413 个。 使用了 threeLayer.toBoxs 对象进行数据加载。

    3. 参考代码:

     1 fetch('https://gw.alipayobjects.com/os/basement_prod/513add53-dcb2-4295-8860-9e7aa5236699.json').then((function (res) {
     2                 return res.json();
     3             })).then(function (json) {
     4                 const data = json.features.slice(0, Infinity).map(function (dataItem) {
     5                     dataItem = gcoord.transform(dataItem, gcoord.AMap, gcoord.WGS84);
     6                     return {
     7                         coordinate: dataItem.geometry.coordinates,
     8                         height: Math.random() * 200,
     9                         value: Math.random() * 10000,
    10                         topColor: '#fff'
    11                     }
    12                 });
    13                 const time = 'time';
    14                 console.time(time);
    15                 const box = threeLayer.toBoxs(data, {}, material);
    16                 bars.push(box);
    17                 console.timeEnd(time);
    18 
    19                 // tooltip test
    20                 box.setToolTip('hello', {
    21                     showTimeout: 0,
    22                     eventsPropagation: true,
    23                     dx: 10
    24                 });
    25                 threeLayer.addMesh(bars);
    26           }

    4. 页面显示

    5. 源码地址:

    https://github.com/WhatGIS/maptalkMap/tree/main/threelayer/demo

     
  • 相关阅读:
    嵌入式系统之微处理器篇
    嵌入式系统之基础概念篇
    八大排序算法简述
    进程-PV操作
    实时操作系统与分时操作系统
    串口助手
    STM32通用定时器功能和用法
    三种主流芯片架构简单比较
    python 我的第一个自动化脚本
    jquery部分实用功能
  • 原文地址:https://www.cnblogs.com/googlegis/p/14733884.html
Copyright © 2011-2022 走看看