国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

使用echarts-gl 繪制3D地球配置詳解

這篇具有很好參考價值的文章主要介紹了使用echarts-gl 繪制3D地球配置詳解。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

大屏可視化繪制關(guān)聯(lián)配置繪制3D地球

為 ECharts 準(zhǔn)備一個定義了寬高的 DOM

 <div :id="'container' + attrs.id" :style="
        'width:' + (attrs.width) + 'px;'
        + 'height:' + (attrs.height) + 'px;' + 'z-index:1;'">
</div>

實(shí)例化

        //初始化地圖
        async initEcharts() {
            this.chart = echarts.init(document.getElementById('container' + this.attrs.id))

            //構(gòu)建填充option
            this.buildOption()

            this.chart.setOption(this.option)
        },

指定圖表的配置項(xiàng)和數(shù)據(jù)文章來源地址http://www.zghlxwxcb.cn/news/detail-510929.html

        buildOption() {
            let style = this.attrs.style
            this.option = {
                backgroundColor: style.backgroundColor,
                globe: {
                    // show: false,
                    globeRadius: style.globeRadius, // 地球的半徑
                    globeOuterRadius: style.globeOuterRadius, // 地球的外半徑
                    baseTexture: style.heightTextureSrcEnable ? (style.heightTextureSrc ? this.heightTextureSrc : require("../zImage/gl/world.topo.bathy.200401.jpg")) : '',  //  背景圖  地球的紋理
                    heightTexture: style.heightTextureSrcEnable ? (style.heightTextureSrc ? this.heightTextureSrc : require("../zImage/gl/world.topo.bathy.200401.jpg")) : '', // 背景圖凹凸貼圖  地球的高度紋理
                    displacementScale: style.displacementScale, // 地球頂點(diǎn)位移的大小
                    displacementQuality: style.displacementQuality, //地球頂點(diǎn)位移的質(zhì)量。支持設(shè)置成 'low', 'medium', 'high', 'ultra'
                    shading: style.shading, //地球中三維圖形的著色效果  color  lambert  realistic
                    environment: style.environmentEnable ? (style.environmentSrc ? this.environmentSrc : require("../zImage/gl/Milkyway/Milkyway_BG.jpg")) : '', // 環(huán)境貼圖
                    realisticMaterial: {
                        roughness: style.realisticMaterialRoughness, // 粗糙度
                    },
                    // 后處理特效的相關(guān)配置
                    postEffect: {
                        enable: style.postEffectEnable, // 是否開啟后處理特效
                        // 高光特效
                        bloom: {
                            enable: style.postEffectBloomEnable,
                            bloomIntensity: style.postEffectBloomBloomIntensity,
                        },
                        // 景深效果
                        depthOfField: {
                            enable: style.depthOfFieldEnable,
                            focalDistance: style.depthOfFieldFocalDistance, // 初始的焦距
                            focalRange: style.depthOfFieldFocalRange, //完全聚焦的區(qū)域范圍
                            fstop: style.depthOfFstop,  //鏡頭的F值,值越小景深越淺。
                            blurRadius: style.depthOfBlurRadius,  // 模糊半徑
                        },
                        SSAO: {
                            enable: style.SSAOEnable,
                            quality: style.SSAOQuality, // 環(huán)境光遮蔽的質(zhì)量
                            radius: style.SSAORadius, // 采樣半徑
                            intensity: style.SSAOIntensity, // 環(huán)境光遮蔽的強(qiáng)度  值越大顏色越深
                        }
                    },
                    // 光照相關(guān)的設(shè)置  shading 為 'color' 的時候無效
                    light: {
                        // 主光源
                        main: {
                            color: style.lightMainColor, // 主光源的顏色
                            intensity: style.lightMainIntensity, // 主光源的強(qiáng)度
                            shadow: style.lightMainShadow, // 主光源是否投射陰影
                            shadowQuality: style.lightMainShadowQuality, // 陰影質(zhì)量

                        },
                        ambient: {
                            color: style.lightAmbientColor,// 環(huán)境光的顏色
                            intensity: style.lightAmbientIntensity, // 環(huán)境光的強(qiáng)度
                        },
                    },
                    // 地球外部大氣層相關(guān)設(shè)置
                    atmosphere: {
                        show: style.atmosphereShow, // 是否顯示外部大氣層
                        color: style.atmosphereColor,
                        glowPower: style.atmosphereGlowPower, // 外部大氣層發(fā)光功率
                        innerGlowPower: style.atmosphereInnerGlowPower, // 外部大氣層內(nèi)發(fā)光功率
                    },
                    // 鼠標(biāo)的旋轉(zhuǎn),縮放等視角控制
                    viewControl: {
                        projection: style.viewControlProjection, // 投影方式,默認(rèn)為透視投影'perspective',也支持設(shè)置為正交投影'orthographic'
                        autoRotate: style.viewControlAutoRotate, // 是否開啟視角繞物體的自動旋轉(zhuǎn)查看。
                        autoRotateDirection: style.viewControlAutoRotateDirection, // 物體自轉(zhuǎn)的方向 'cw'順時針方向 'ccw'逆時針方向
                        autoRotateSpeed: style.viewControlAutoRotateSpeed, // 物體自轉(zhuǎn)的速度  單位為角度 / 秒,默認(rèn)為10 ,也就是36秒轉(zhuǎn)一圈
                        autoRotateAfterStill: style.viewControlAutoRotateAfterStill, // 在鼠標(biāo)靜止操作后恢復(fù)自動旋轉(zhuǎn)的時間間隔
                        zoomSensitivity: style.viewControlZoomSensitivity, // 鼠標(biāo)靈敏度
                        distance: style.viewControlDistance, // 默認(rèn)視角距離主體的距離
                        minDistance: style.viewControlMinDistance, // 鼠標(biāo)控制能拉近到主體的最小距離
                        maxDistance: style.viewControlMaxDistance, // 鼠標(biāo)控制能拉遠(yuǎn)到主體的最大距離
                    },
                },
                series: [
                    {
                        type: 'lines3D',
                        coordinateSystem: 'globe',
                        blendMode: style.blendMode,  // 'lighter'是疊加模式  'source-over'是通過 alpha 混合
                        // 飛線尾跡特效
                        effect: {
                            show: style.effectShow,
                            period: style.effectPeriod, // 尾跡周期 
                            constantSpeed: style.effectConstantSpeed, // 軌跡特效的移動動畫是否是固定速度
                            trailWidth: style.effectTrailWidth, //尾跡的寬度。
                            trailLength: style.effectTrailLength, // 尾跡的長度,范圍從 0 到 1,為線條長度的百分比
                            trailColor: style.effectTrailColor,  //尾跡的顏色
                            trailOpacity: style.effectTrailOpacity, // 尾跡的不透明度
                            // symbol: 'path://"M61.3,2c6.2,0,12.1,1.1,17.5,3.4C84.3,7.7,89,10.8,93,14.6c4.1,4,7.3,8.6,9.7,13.8c2.4,5.2,3.5,10.9,3.5,16.9c0,8.1-2.4,16.9-7.1,26.4c-4.7,9.4-9.9,18.2-15.5,26.2c-5.6,8-13.1,17.4-22.4,28.1c-9.3-10.7-16.8-20-22.4-28.1c-5.6-8-10.8-16.8-15.5-26.2c-4.7-9.4-7.1-18.2-7.1-26.4c0-6,1.2-11.6,3.5-16.9c2.4-5.2,5.6-9.8,9.7-13.8c4-3.9,8.8-7,14.2-9.2C49.2,3.1,55,2,61.3,2L61.3,2z"',
                            symbol: "arrow", //箭頭圖標(biāo)
                            symbolSize: 10, //圖標(biāo)大小
                        },
                        lineStyle: {
                            width: style.lineStyleWidth,
                            color: style.lineStyleColor,
                            opacity: style.lineStyleOpacity,// 線條的不透明度
                        },
                        data: [
              [
                [-75.440806, 40.652083],
                [80.943139, 35.214],
              ],
              [
                [86.02, 37.77],
                [-109.09, 41.82],
              ],
              [
                [90.24, 35.23],
                [-61.63, -21.06],
              ],
              [
                [113.62, 25.23],
                [91.82, 36.79],
              ],
              [
                [112.57, 25.39],
                [149.66, -29.17],
              ],
              [
                [24.5, -18.41],
                [113.97, 32.01],
              ],
              [
                [-9.43, 15.18],
                [-66.2, 1.48],
              ],
            ],
                    },
                ],
            };

        },

到了這里,關(guān)于使用echarts-gl 繪制3D地球配置詳解的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • echarts + echarts-gl - 使用geo3d + map3d + scatter3D做3d地圖

    echarts + echarts-gl - 使用geo3d + map3d + scatter3D做3d地圖

    一、使用插件 echarts@5.2.2 、 echarts-gl@2.0.8 、 jquery ; jquery 是使用 ajax 加載 json 文件的。 二、準(zhǔn)備地圖json文件 因?yàn)檎伊艘蝗?,網(wǎng)上的地圖 js 文件都需要花錢去購買, json 文件可以在阿里云數(shù)據(jù)可視化平臺下載,下載鏈接為:免費(fèi)地圖json文件下載 ECharts 提供了兩種格式的地圖數(shù)

    2024年02月16日
    瀏覽(51)
  • echarts-gl的type為map3D修改不同區(qū)域的顏色和點(diǎn)擊事件

    echarts-gl的type為map3D修改不同區(qū)域的顏色和點(diǎn)擊事件

    效果圖 regions 的數(shù)據(jù)格式 以下是 地圖初始化代碼、雙擊地圖和單擊高亮 ,方法是封裝后的,mapData 的數(shù)據(jù)格式我放在后面,均有注釋 這個是手動區(qū)分,就看綠色框框的,feature.properties.num就是各個區(qū)人數(shù) mapData 的數(shù)據(jù)格式

    2024年02月19日
    瀏覽(23)
  • echarts+echarts-gl vue2制作3D地圖+下鉆功能+標(biāo)記點(diǎn)功能,解決dblclick事件失效問題,解決地圖下鉆后邊框不更新保留問題

    echarts+echarts-gl vue2制作3D地圖+下鉆功能+標(biāo)記點(diǎn)功能,解決dblclick事件失效問題,解決地圖下鉆后邊框不更新保留問題

    目錄 先看實(shí)現(xiàn)效果:?編輯 步驟一 安裝echarts和echarts-gl 步驟二? 設(shè)置地圖容器 在methods中設(shè)置初始化地圖方法并在mounted中調(diào)用 在methods中設(shè)置初始化地圖方法 在mounted中調(diào)用 打開頁面效果:?編輯 ?步驟三 1、給地圖添加雙擊事件dblclick 但是也出現(xiàn)了一個問題,和我們預(yù)想的

    2023年04月09日
    瀏覽(23)
  • Vue 中使用Echarts構(gòu)建3D地球

    Vue 中使用Echarts構(gòu)建3D地球

    一:要用Echarts實(shí)現(xiàn)3D地球 除了 echarts還是遠(yuǎn)遠(yuǎn)不夠的 ,除了echarts外 我們?還得引用 echarts-gl? jquery 也是需要的 不然會有多次報錯 1.收首先在 main.js中分別引入所需的插件, 此外 除了在main.js中 在相應(yīng).vue 中也需要引用 使用echarts的3D功能 全局引入Echarts-gl 一般建議裝最低版本

    2024年02月12日
    瀏覽(28)
  • echarts實(shí)現(xiàn)3D地球模式--3D線

    echarts實(shí)現(xiàn)3D地球模式--3D線

    前言:基于echarts實(shí)現(xiàn)3D地球自動旋轉(zhuǎn)展示及不同坐標(biāo)點(diǎn)相互連線 這里主體基于echarts,需引入依賴資源 echarts.min.js,echarts-gl.min.js 效果如下: 代碼如下: 依賴資源 HTML CSS JS 貼圖奉上 echarts官方文檔地址:https://echarts.apache.org/zh/index.html 簡單記錄如有問題或更優(yōu)解還請不要吝嗇

    2024年02月04日
    瀏覽(22)
  • 【echarts】使用 ECharts 繪制3D餅圖

    【echarts】使用 ECharts 繪制3D餅圖

    在數(shù)據(jù)可視化中,餅圖是表達(dá)數(shù)據(jù)占比信息的常見方式。ECharts 作為一個強(qiáng)大的數(shù)據(jù)可視化庫,除了標(biāo)準(zhǔn)的二維餅圖,也支持更加生動的三維餅圖繪制。本文將指導(dǎo)你如何使用 ECharts 來創(chuàng)建一個3D餅圖,提升你的數(shù)據(jù)展示效果。 在 ECharts 中,3D 餅圖主要是通過 surface 類型的圖

    2024年04月27日
    瀏覽(20)
  • Echarts 3d地球?qū)崿F(xiàn)(Vue框架)

    Echarts 3d地球?qū)崿F(xiàn)(Vue框架)

    最近迷上了echarts實(shí)現(xiàn)數(shù)據(jù)可視化了,也確實(shí)因?yàn)楣ぷ餍枰?,目前公司需要我們來在自己的新廠房展廳把自己的產(chǎn)品展示出來,我所在研發(fā)部軟件組,第一個想到的就是使用echarts來實(shí)現(xiàn)一個數(shù)據(jù)可視化的大屏了,下面就帶著大家看看我這段時間使用Echarts來實(shí)現(xiàn)一個3D地球的過

    2024年04月25日
    瀏覽(28)
  • Echarts實(shí)現(xiàn)3D地球加衛(wèi)星環(huán)繞效果

    Echarts實(shí)現(xiàn)3D地球加衛(wèi)星環(huán)繞效果

    通過echarts實(shí)現(xiàn)自動旋轉(zhuǎn)3D地球加衛(wèi)星環(huán)繞效果 全部使用 按需使用 代碼如下: 衛(wèi)星環(huán)繞效果通過scatter3D實(shí)現(xiàn),將symbolSize設(shè)置為0,通過label-textStyle-backgroundColor-image設(shè)置衛(wèi)星圖片,代碼如下: 衛(wèi)星伴隨地球自轉(zhuǎn),缺點(diǎn)在于速度與地球相同,暫時未找到更好的替代方法。 完整代

    2024年02月17日
    瀏覽(21)
  • vue3+echarts實(shí)現(xiàn)3D地球+飛線

    vue3+echarts實(shí)現(xiàn)3D地球+飛線

    效果圖 1、下載 ? ? ? ? 指令 我的版本: 2、html容器 3、js代碼 附加紋理圖

    2024年02月04日
    瀏覽(25)
  • vue echarts 3D地球和世界地圖的實(shí)現(xiàn),并且顯示不同國家的數(shù)據(jù)

    vue echarts 3D地球和世界地圖的實(shí)現(xiàn),并且顯示不同國家的數(shù)據(jù)

    別忘記給#earth元素設(shè)置寬高 效果如下圖 別忘記給#world元素設(shè)置寬高 其中注意點(diǎn)是world.js 下載地址 下載完成以后需要對其進(jìn)行改變一下,原本是他是放在一個匿名自執(zhí)行函數(shù)里面,直接在vue里面引用會報錯,要把他變成 export 對象,代碼片段實(shí)例 效果如下圖 關(guān)鍵點(diǎn)在globe里面

    2024年02月04日
    瀏覽(27)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包