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

vue3 mars3d 天地圖

這篇具有很好參考價值的文章主要介紹了vue3 mars3d 天地圖。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

準備工作:

????????安裝mars3d依賴:

????????????????npm i?mars3d?

????????????????npm i mars3d-heatmap (熱力圖,需要的話安裝)

????????????????npm i -D?copy-webpack-plugin

????????????????增加mars3d目錄配置,修改vue.config.js中configureWebpack里的內(nèi)容如下:

const CopyWebpackPlugin = require("copy-webpack-plugin");
const cesiumSourcePath = "node_modules/mars3d-cesium/Build/Cesium/"; // cesium庫安裝目錄
const cesiumRunPath = "./mars3d-cesium/"; // cesium運行時路徑
const timeStamp = Date.now()
module.exports = {
    configureWebpack: (config) => {
    const plugins = [
      // 標識cesium資源所在的主目錄,cesium內(nèi)部資源加載、多線程等處理時需要用到
      new webpack.DefinePlugin({
        CESIUM_BASE_URL: JSON.stringify(path.join(config.output.publicPath, cesiumRunPath))
      }),
      // Cesium相關資源目錄需要拷貝到系統(tǒng)目錄下面(部分CopyWebpackPlugin版本的語法可能沒有patterns)
      new CopyWebpackPlugin([
          { from: path.join(cesiumSourcePath, 'Workers'), to: path.join(config.output.path, cesiumRunPath, 'Workers') },
          { from: path.join(cesiumSourcePath, 'Assets'), to: path.join(config.output.path, cesiumRunPath, 'Assets') },
          { from: path.join(cesiumSourcePath, 'ThirdParty'), to: path.join(config.output.path, cesiumRunPath, 'ThirdParty') },
          { from: path.join(cesiumSourcePath, 'Widgets'), to: path.join(config.output.path, cesiumRunPath, 'Widgets') }
      ])
    ]

    if (process.env.NODE_ENV === "production") {
      plugins.push(
        new UglifyJSPlugin({
          uglifyOptions: {
            //刪除注釋
            output: {comments: false},
            warnings: false,
            //刪除console 和 debugger  刪除警告
            compress: {
              drop_debugger: true,
              drop_console: true
            }
          },
          cache: true, // 啟用文件緩存
          sourceMap: false,//不生成調(diào)試文件
          parallel: true // 使用多進程并行運行來提高構(gòu)建速度
        })
      );
    }
    config.plugins = [...config.plugins, ...plugins]
    //給打包的文件名加上時間戳,防止瀏覽器緩存

    config.output.filename = `js/[name].${timeStamp}.js`
    config.output.chunkFilename = `js/[name].${timeStamp}.js`

    return {
      module: { unknownContextCritical: false }, // 配置加載的模塊類型,cesium時必須配置
      plugins: plugins
    }
  },
  //...其它配置
}

組件頁:

<template>
  <div class="r-map-3d">
    <div class="map-box" :id="mapId"></div>
  </div>
</template>
<script setup>
import {defineEmits, defineProps, onMounted, reactive, ref} from 'vue'
import mars3D from '@/plugins/mars3d/mapController'

const props = defineProps({
  //中心點
  center: {
    type: Array,
    default: () => [0, 0]
  }
})
const emit = defineEmits(['onLoad']);
const mapId = ref(`map_${Date.now()}`)

const data = reactive({
  map: null,
})

onMounted(() => {
  data.map = new mars3D(mapId.value, props.center)
  emit('onLoad', data.map)
})
</script>
<style scoped lang="scss">
.r-map-3d {
  width: 100%;
  height: 100%;

  .map-box {
    height: 100%;
    width: 100%;
  }
}
</style>

mapController.js:(地圖操作類)

import {mapUrl, mapAk} from "@/config/baseURL";
//引入cesium基礎庫
import "mars3d-cesium/Build/Cesium/Widgets/widgets.css";
import * as Cesium from "mars3d-cesium";
//導入mars3d主庫
import "mars3d/dist/mars3d.css";
import * as mars3d from "mars3d";
import "mars3d-heatmap"

export default class MapController {
    constructor(mapId) {
        this.ak = mapAk
        this.mapId = mapId

        /** 地圖實例 */
        this.instance = null

        this.initMap()
    }

    /**
     * 創(chuàng)建天地圖層
     * @param name 描述
     * @auth Roffer
     * @date 2022/9/29 15:50
     *
     */
    initMap() {
        // 需要覆蓋config.json中地圖屬性參數(shù)(當前示例框架中自動處理合并)
        //option相關設置:http://mars3d.cn/apidoc.html#Map
        const mapOptions = {
            //scene相關設置:http://mars3d.cn/api/Map.html#.sceneOptions
            scene: {
                center: {lat: 29.068075, lng: 103.966252, alt: 82849.5, heading: 358.9, pitch: -28.4},
                showSkyAtmosphere: false,
                backgroundColor: '#000',
                contextOptions: {
                    webgl: {
                        //通過canvas.toDataURL()實現(xiàn)截圖需要將該項設置為true
                        preserveDrawingBuffer: true
                    }
                },
                cameraController: {
                    //相機最近視距,變焦時相機位置的最小量級(以米為單位),默認為1。該值是相機與地表(含地形)的相對距離。默認1.0
                    minimumZoomDistance: 1,
                    //相機最遠視距,變焦時相機位置的最大值(以米為單位)。該值是相機與地表(含地形)的相對距離。默認50000000.0
                    maximumZoomDistance: 200000
                },
                globe: {
                    show: true,//是否顯示地球
                }
            },
            // control: {
            //     locationBar: {
            //         fps: true,//是否顯示實時FPS幀率
            //         navigationHelpButton: true
            //     }
            // },
        }

        this.instance = new mars3d.Map(this.mapId, mapOptions); //支持的參數(shù)請看API文檔:http://mars3d.cn/api/Map.html
        this.instance.basemap = 2017 // 藍色底圖
        const mapLayer = mars3d.LayerUtil.create({
            type: "wmts",
            url: mapUrl,
            //wmts服務元數(shù)據(jù)中指定的layer值
            format: "image/png",
            layer: "defaultLayer",
            style: "default",
            //跨域支持,在使用html2canvas截屏的時候,如果不設置該屬性,會截不到地圖內(nèi)容
            crossOrigin: 'Anonymous',
            tileMatrixSetID: "GetTileMatrix",
            minimumLevel: 3,
            maximumLevel: 17,
            minimumTerrainLevel: 1,
            maximumTerrainLevel: 25,
            zIndex: 2,
            crs: "EPSG4490",
            chinaCRS: "WGS84",
            tileWidth: 256,
            tileHeight: 256,
            name: "影像",
            extent: {
                xmin: 96.8064823,
                ymin: 25.68096106,
                xmax: 109.1252279,
                ymax: 34.75215408
            }
        })

        this.instance.addLayer(mapLayer)

        //獲取右鍵菜單繪制完成數(shù)據(jù)
        this.instance.on(mars3d.EventType.drawCreated, (e) => {
            console.log(JSON.stringify(e.graphic));
        })
    }

    /**
     * 區(qū)域標記
     * @param areaCode 區(qū)域編碼
     * @param filter 透明度,默認不透明,值范圍:0~1
     * @param popupState 點擊地圖popup顯隱
     * @auth Roffer
     * @date 2022/11/10 19:03
     *
     */
    addAreaLayer(areaCode = '510100000000', filter = 1, styleCback,popupState=true) {
        const geoJsonLayer = new mars3d.layer.GeoJsonLayer({
            name: "成都市",
            url: `/json/5101/${areaCode}.json`,
            allowDrillPick: true,
            symbol: {
                type: "polygon",
                styleOptions: {
                    materialType: mars3d.MaterialType.PolyGradient, // 重要參數(shù),指定材質(zhì)
                    // materialType: mars3d.MaterialType.Stripe, // 重要參數(shù),指定材質(zhì)
                    materialOptions: {
                        color: "#3388cc",
                        opacity: 0.7,
                        alphaPower: 1.3
                    },
                    // 面中心點,顯示文字的配置
                    label: {
                        text: "{name}", // 對應的屬性名稱
                        opacity: 1,
                        font_size: 18,
                        color: "#fff",
                        font_family: "宋體",
                        outline: false,
                        scaleByDistance: true,
                        scaleByDistance_far: 20000000,
                        scaleByDistance_farValue: 0.1,
                        scaleByDistance_near: 1000,
                        scaleByDistance_nearValue: 1
                    }
                },
                callback: styleCback ? styleCback : function (attr, styleOpt) {
                    const randomHeight = (attr.childrenNum || 1) * 600 // 測試的高度
                    return {
                        materialOptions: {
                            color: attr.fill,
                            alphaPower: filter
                            // color: getColor()
                        },
                        height: 20,
                        diffHeight: randomHeight
                    }
                }
            },
            popup:popupState ? "{name}" : false
        })
        this.instance.addLayer(geoJsonLayer)

        const arrColor = ["rgb(15,176,255)", "rgb(18,76,154)", "#40C4E4", "#42B2BE", "rgb(51,176,204)", "#8CB7E5", "rgb(0,244,188)", "#139FF0"]

        let index = 0

        function getColor() {
            return arrColor[++index % arrColor.length]
        }

        return geoJsonLayer
    }

    /**
     * 添加自定義多邊形
     * @param geoJson geoJson數(shù)據(jù)
     * @param color 多邊形顏色
     * @auth Roffer
     * @date 2022/12/8 11:01
     *
     */
    addCustomLayer({pointList, color, text, popup, popupOptions, tooltip, tooltipOptions}) {
        const graphicLayer = this.genGraphicLayer()
        const graphic = new mars3d.graphic.PolygonEntity({
            positions: pointList,
            style: {
                color,
                opacity: 0.5,
                outline: false,
                outlineWidth: 3,
                outlineColor: "#ffffff",
                highlight: {
                    opacity: 0.8
                },
                label: {
                    show: false,
                    text,
                    font_size: 12,
                    color: "#ffffff",
                    distanceDisplayCondition: true,
                    distanceDisplayCondition_far: 500000,
                    distanceDisplayCondition_near: 0
                }
            },
            popup,
            popupOptions,
            tooltip,
            tooltipOptions
        })

        graphicLayer.addGraphic(graphic)
        this.instance.addLayer(graphicLayer)

        return graphicLayer
    }

    /**
     * 添加一個自定義標注層
     * @auth Roffer
     * @date 2022/11/11 14:19
     *
     */
    genGraphicLayer() {
        let graphicLayer = new mars3d.layer.GraphicLayer()
        this.instance.addLayer(graphicLayer)
        return graphicLayer
    }

    /**
     * 添加自定義html標記點,適用于小于100條數(shù)據(jù)
     * @param point 經(jīng)緯度,示例:[123.1,22.444]
     * @param html 要顯示的html內(nèi)容
     * @param popup 自定義詳細信息(String,Array,function)
     * @param popupOptions 自定義詳細信息參數(shù)設置(Object)詳情:http://mars3d.cn/api/Popup.html#.StyleOptions
     * @param tooltip 自定義鼠標懸浮提示信息(String,Array,function)
     * @param tooltipOptions 自定義鼠標懸浮提示信息參數(shù)設置(Object)詳情:http://mars3d.cn/api/Tooltip.html#.StyleOptions
     * @param attr 附加自定義屬性(可在點擊時,通過e.target.attr獲?。?     * @param click 點擊回調(diào)函數(shù)(返回點擊的對象)
     * @param style Object,覆蓋style對象中的屬性值
     * @auth Roffer
     * @date 2022/10/22 14:55
     *
     */
    addDivLayer({point, html, popup, popupOptions, tooltip, tooltipOptions, attr, click, style}, graphicLayer) {
        const graphic = new mars3d.graphic.DivGraphic({
            position: new mars3d.LngLatPoint(point[0], point[1], 915),
            style: {
                html,
                horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
                verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                clampToGround: true,
                offsetX: -20,
                offsetY: -30,
                ...style
            },
            attr,
            popup,
            popupOptions,
            tooltip,
            tooltipOptions,
            eventParent: false,//不冒泡事件
        })
        graphicLayer.addGraphic(graphic)

        click && graphic.on(mars3d.EventType.click, click)

        return graphicLayer
    }

    /**
     * 批量添加html標標注
     * @param list 數(shù)據(jù),
     *         格式為:
     *              [{
     *                  point:[103.111,30.123],html:'<div>xxx</div>',attr:{},click:()=>{}
     *              },...]
     * @auth Roffer
     * @date 2022/11/11 14:00
     *
     */
    batchAddDivLayer(list = []) {
        // 創(chuàng)建矢量數(shù)據(jù)圖層
        let graphicLayer = this.genGraphicLayer()

        list.forEach(item => {
            this.addDivLayer(item, graphicLayer)
        })

        return graphicLayer
    }

    /**
     * 獲取當前屏幕邊界坐標
     * @auth Roffer
     * @date 2022/11/21 15:37
     *
     */
    getScreenXY() {
        //屏幕邊界坐標
        let info = this.instance.viewer.camera.computeViewRectangle()
        info.east = Cesium.Math.toDegrees(info.east)
        info.north = Cesium.Math.toDegrees(info.north)
        info.south = Cesium.Math.toDegrees(info.south)
        info.west = Cesium.Math.toDegrees(info.west)
        // east 104.58916517174933
        // north 30.8081617249502
        // south 30.48271217718593
        // west 103.95342383654778
        return info
    }

    /**
     * 添加自定義標記點
     * @param data 參數(shù)對象,包含以下:
     *              url 請求數(shù)據(jù)的接口地址(url、data二選一)
     *              dataColumn data字段key(url時指定)
     *              data 請求數(shù)據(jù)的接口地址(url、data二選一)
     *              lngColumn 經(jīng)緯字段key
     *              latColumn 緯緯字段key
     *              altColumn 高度字段key
     *              positionIconImg 顯示的圖標圖片
     *              showGroup 是否顯示聚合分組數(shù)據(jù),默認true顯示
     *              text 顯示的名稱字段key
     * @param popup 詳細信息對象
     *          key:對象中的key值
     *          item[key]:顯示的名稱 eg:{name:'名稱'}
     * @auth Roffer
     * @date 2022/10/22 14:55
     *
     */
    addBusineDataLayer(data, popup) {
        let option = {
            showGroup: true,
            ...data
        }
        // 創(chuàng)建矢量數(shù)據(jù)圖層(業(yè)務數(shù)據(jù)圖層)
        let busineDataLayer = new mars3d.layer.BusineDataLayer({
            ...option,
            symbol: {
                type: "billboard", // 對應是 mars3d.graphic.BillboardEntity
                styleOptions: {
                    image: option.positionIconImg,
                    horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                    verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                    scaleByDistance: new Cesium.NearFarScalar(1000, 0.7, 5000000, 0.3),
                    visibleDepth: false,
                    // label: {
                    //     text: `{${data.text || 'text'}}`,
                    //     font_size: 13,
                    //     color: Cesium.Color.AZURE,
                    //     outline: true,
                    //     outlineColor: Cesium.Color.BLACK,
                    //     outlineWidth: 2,
                    //     horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
                    //     verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                    //     pixelOffset: new Cesium.Cartesian2(10, 0), // 偏移量
                    //     distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 80000)
                    // }
                }
            },
            // 點的聚合配置
            clustering: {
                enabled: option.showGroup,
                pixelRange: 20,
                clampToGround: false,
                opacity: 1,
                // getImage: function (count) {   //getImage是完全自定義方式
                //   let colorIn
                //   if (count < 10) {
                //     colorIn = 'rgba(110, 204, 57, 0.6)'
                //   } else if (count < 100) {
                //     colorIn = 'rgba(240, 194, 12,  0.6)'
                //   } else {
                //     colorIn = 'rgba(241, 128, 23,  0.6)'
                //   }
                //   return mars3d.Util.getCircleImage(count, {
                //     color: colorIn,
                //     radius: 30,
                //   })
                // },
            }
        })

        this.instance.addLayer(busineDataLayer)

        //包含詳情
        if (popup) {
            //詳細信息彈窗
            busineDataLayer.bindPopup(function (event) {
                const item = event.graphic?.attr
                if (!item) {
                    return false
                }
                const tabData = [
                    `<table style="width: auto;">
                    <tr><th scope="col" colspan="2" style="text-align:center;font-size:15px;">${item[option.text]}</th></tr>`
                ]
                for (let key in popup) {
                    tabData.push(`<tr>`)
                    tabData.push(`<td>${popup[key]}</td><td>${item[key]}</td>`)
                    tabData.push(`</tr>`)
                }
                tabData.push('</table>')
                return tabData.join('')
            })

            busineDataLayer.bindTooltip(function (event) {
                const item = event.graphic?.attr
                if (!item) {
                    return false
                }
                const tabData = [
                    `<table style="width: auto;">
                    <tr><th scope="col" colspan="2" style="text-align:center;font-size:15px;">${item[option.text]}</th></tr>`
                ]
                for (let key in popup) {
                    tabData.push(`<tr>`)
                    tabData.push(`<td>${popup[key]}</td><td>${item[key]}</td>`)
                    tabData.push(`</tr>`)
                }
                tabData.push('</table>')
                return tabData.join('')
            })
        }

        // 單擊事件
        busineDataLayer.on(mars3d.EventType.click, (event) => {
            if (this.instance.camera.positionCartographic.height > 1000) {
                const graphic = event.graphic
                if (graphic) {
                    // 單擊了具體的點對象
                    // graphic.closePopup()

                    const position = graphic.positionShow
                    this.instance.flyToPoint(position, {
                        radius: 1000, // 距離目標點的距離
                        duration: 3,
                        complete: function (e) {
                            // 飛行完成回調(diào)方法
                            // graphic.openPopup()
                        }
                    })
                } else {
                    // 單擊了聚合的點
                    const arrEntity = event.pickedObject.id
                    this.instance.flyTo(arrEntity)
                }
            }
        })

        return busineDataLayer
    }

    /**
     * 兩點連線(弧線)
     * @param startPoint 起始經(jīng)緯度
     * @param endPoint 結(jié)束經(jīng)緯度
     * @param attr 顯示的信息對象(object,key、value格式)
     * @param popup 點擊時顯示的信息
     * @param popupOptions 點擊時顯示的信息參數(shù)設置對象,如可以設置偏移量{offsetX:-10,offsetY:-10},更多參數(shù):http://mars3d.cn/api/Popup.html#.StyleOptions
     * @param tooltip hover時顯示的信息
     * @param tooltipOptions hover時顯示的信息參數(shù)設置對象,如可以設置偏移量{offsetX:-10,offsetY:-10},更多參數(shù):http://mars3d.cn/api/Tooltip.html#.StyleOptions
     * @param lineColor 線條的顏色(默認:#1a9850)
     * @auth Roffer
     * @date 2022/12/3 11:04
     *
     */
    addArc({startPoint, endPoint, attr, popup, popupOptions, tooltip, tooltipOptions, lineColor}, graphicLayer) {
        graphicLayer = graphicLayer || this.genGraphicLayer()
        const start = Cesium.Cartesian3.fromDegrees(...startPoint, 42.31)
        const end = Cesium.Cartesian3.fromDegrees(...endPoint, 37.53)
        const positions = mars3d.PolyUtil.getLinkedPointList(start, end, 20000, 50) // 計算曲線點

        const graphic = new mars3d.graphic.PolylineEntity({
            positions: positions,
            style: {
                width: 10,
                // 動畫線材質(zhì)
                materialType: mars3d.MaterialType.LineFlow,
                materialOptions: {
                    image: require('@/assets/img/map_icon/line-arrow-blue.png'),
                    color: lineColor || '#1a9850',
                    mixt: false,
                    speed: 20,
                    repeat: new Cesium.Cartesian2(5, 1)
                }
            },
            attr,
            popup,
            popupOptions,
            tooltip,
            tooltipOptions
        })
        graphicLayer.addGraphic(graphic)

        return graphicLayer
    }

    /**
     * 熱力圖
     * @param pointData 經(jīng)緯度數(shù)組 [{lng:123,lat:456},...]
     * @auth Roffer
     * @date 2022/11/11 14:58
     *
     */
    addHeatLayer(pointData) {
        // 熱力圖 圖層
        let heatLayer = new mars3d.layer.HeatLayer({
            positions: pointData,
            // rectangle: rectangle,
            // 以下為熱力圖本身的樣式參數(shù),可參閱api:https://www.patrick-wied.at/static/heatmapjs/docs.html
            heatStyle: {
                radius: 40,
                blur: 0.85
            },
            // 以下為矩形矢量對象的樣式參數(shù)
            style: {
                arc: true, // 是否為曲面
                height: 100.0,
                opacity: 0.6,
                // classificationType: Cesium.ClassificationType.CESIUM_3D_TILE,
                // clampToGround: true
            }
        })

        this.instance.addLayer(heatLayer)

        return heatLayer
    }

    /**
     * 刪除layer
     * @param layer layer對象
     * @auth Roffer
     * @date 2022/11/11 14:26
     *
     */
    removeLayer(layer) {
        this.instance.removeLayer(layer)
    }
}

?使用:

<r-map-3d @onLoad="mapLoad"/>
<script setup>
let map = null//地圖實例
let areaLayer = null//圖層的操作最好不要定義在vue3的響應式對象中,否則會引起頁面卡頓
/** 地圖加載完成 */
const mapLoad = (instance) => {
  map = instance
  areaLayer = map.addAreaLayer('510100000000')
}
</script>

最后附上天地圖mapUrl地址:

export const mapAk = 'xxxx'//請自行去官方申請
//淺色底圖
// export const mapUrl = `http://www.scgis.net/services/newtianditudlg/WMTS?ak=${mapAk}`
//暗色底圖
export const mapUrl = `http://www.scgis.net/services/tdtdarkmap/WMTS?ak=${mapAk}`

?省市區(qū)地圖json數(shù)據(jù),請移步到https://geojson.cn/?根據(jù)業(yè)務需求下載對應的json數(shù)據(jù)

mars3d官網(wǎng)?文章來源地址http://www.zghlxwxcb.cn/news/detail-616106.html

到了這里,關于vue3 mars3d 天地圖的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

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

領支付寶紅包贊助服務器費用

相關文章

  • vue3 + vite + ts 集成mars3d

    vue3 + vite + ts 集成mars3d

    使用mars3d過程中,需要集成mars3d到自己的項目中,mars3d開發(fā)教程中已經(jīng)有集成好的項目模板 http://mars3d.cn/doc.html 項目模板gitte地址:https://gitee.com/marsgis/mars3d-vue-template/tree/master/mars3d-vue3-vite 如果不想用官方的模板就需要自己集成 如何創(chuàng)建項目參考網(wǎng)上的教程,這里就不做詳細

    2024年02月06日
    瀏覽(40)
  • Vue3項目中集成mars3D簡單三部曲

    Vue3項目中集成mars3D簡單三部曲

    這里是參考網(wǎng)址,大佬可以點擊一件跳轉(zhuǎn) 1.安裝依賴 2.修改 vite.config.ts 配置文件 3. 新建DIV容器 + 創(chuàng)建地圖 新建map.ts文件,以下代碼閉眼直接copy vue文件引入map.ts,以下代碼閉眼直接copy 快去試試吧~

    2024年01月25日
    瀏覽(24)
  • 【mars3d】基于vue3的marsgis通用UI庫 mars-ui 的使用

    【mars3d】基于vue3的marsgis通用UI庫 mars-ui 的使用

    一名腦殘程序員的mars-ui心酸使用記錄。 通過mars3d的官網(wǎng)我們可以看到,有配套的UI庫使用,那么我們?nèi)绾问褂玫阶约旱捻椖恐心?,跟著文章一步一步來吧?1、引入UI庫 ① 安裝 ant-design-vue ② 下載基于vue開發(fā)的mars3d的源碼,直通車: git clone https://gitee.com/marsgis/mars3d-vue-project.gi

    2024年02月09日
    瀏覽(79)
  • 【mars3d】Vue3項目集成mard3d實現(xiàn)gis空間地理系統(tǒng)

    【mars3d】Vue3項目集成mard3d實現(xiàn)gis空間地理系統(tǒng)

    最近公司的業(yè)務邏輯需要使用到gis空間地理系統(tǒng),最開始使用的是Cesium.js.涉及東西很多,對新手不是太友好,傳送門: https://cesium.com/platform/cesiumjs/ . 業(yè)務要使用到很多特效,剛接觸到Cesium,很多效果實現(xiàn)起來很雞肋,mars3d則很適合新手.文檔與示例也很全,現(xiàn)在記錄一下vue3項目如何集

    2024年02月13日
    瀏覽(26)
  • Vue2項目使用mars3d

    或參考webpack.config.js寫法進行修改

    2024年02月14日
    瀏覽(57)
  • vue集成mars3d后,basemaps加不上去

    vue集成mars3d后,basemaps加不上去

    首先: template ? div id=\\\"centerDiv\\\" class=\\\"mapcontainer\\\" ? ? mars-map :url=\\\"configUrl\\\" @οnlοad=\\\"onMapload\\\" / ? /div /template script import MarsMap from \\\'../components/mars-work/mars-map.vue\\\' import * as mars3d from \\\'mars3d\\\' //npm install mars3d-echarts --save import \\\'mars3d-echarts\\\' const Cesium = mars3d.Cesium export default { ? // eslint-disabl

    2024年02月10日
    瀏覽(24)
  • Mars3d引用單個示例文件WeiVectorTileLayer.js報錯的解決辦法

    Mars3d引用單個示例文件WeiVectorTileLayer.js報錯的解決辦法

    參考文檔修改文件后,發(fā)現(xiàn)依然報錯: Mars3d單獨引用示例文件教程_3d文件示例_綿綿-火星科技的博客-CSDN博客 具體報錯截圖: es5的方式直接丟到mars3d包下,mars3d如果node方式引入,這個衛(wèi)片js就需要改造下暴漏主函數(shù)名。 ?看報錯是:?CesiumVectorTile.js里的錯誤,進去看看錯誤行

    2023年04月21日
    瀏覽(40)
  • Mars3D使用教程

    Mars3D使用教程

    1、使用npm安裝依賴庫 //安裝mars3d主庫 ? //安裝mars3d插件(按需安裝) ? //安裝copy-webpack-plugin 插件在第3步中使用,根據(jù)webpack版本安裝,不匹配的版本可能出錯,版本需要5.0 “copy-webpack-plugin”: “^5.0.0”, 2.在main.js全局導入 或者 在使用mars3d的文件中導入(這一步可以跳過,

    2024年02月02日
    瀏覽(30)
  • mars3d繪制區(qū)域范圍(面+邊框)

    mars3d繪制區(qū)域范圍(面+邊框)

    1、圖例(綠色面區(qū)域+白色邊框) ?2、代碼 1)、繪制區(qū)域ts文件 解釋: 1、new mars3d.layer.GeoJsonLayer ? ? ?生成矢量圖層 2、styleField ? ? ? \\\"levels\\\" 是在json文件中區(qū)分不同級別景區(qū)的標志,值為1、2、3等 3、styleFieldOptions ? ? ? 根據(jù)styleField獲取到的值進行區(qū)分,劃分不同顏色的

    2024年02月15日
    瀏覽(26)
  • Mars3D Studio 的使用方法

    Mars3D Studio 的使用方法

    mars3d Studio 是 mars3d 研發(fā)團隊于近期研發(fā)上線的一款 場景可視化編輯平臺。擁有資源存檔、團隊協(xié)作、定制材質(zhì)等豐富的功能??梢詫崿F(xiàn)零代碼構(gòu)建一個可視化三維場景。 (1)數(shù)據(jù)上傳:目前支持 tif 影像上傳、 3dtitles 、 gltf 小模型上傳以及矢量數(shù)據(jù)( shp、gesojson、kml ) 下

    2023年04月16日
    瀏覽(30)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領取紅包

二維碼2

領紅包