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

Mars3d采用ellipsoid球?qū)崿F(xiàn)模擬地球旋轉(zhuǎn)效果

這篇具有很好參考價值的文章主要介紹了Mars3d采用ellipsoid球?qū)崿F(xiàn)模擬地球旋轉(zhuǎn)效果。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

1.Mars3d采用ellipsoid球?qū)崿F(xiàn)模擬地球旋轉(zhuǎn)效果

2.開始自選裝之后,模型一直閃爍

http://mars3d.cn/editor-vue.html?id=graphic/entity/ellipsoid

3.相關(guān)代碼:

import * as mars3d from "mars3d"

export let map // mars3d.Map三維地圖對象
export let graphicLayer // 矢量圖層對象
export const eventTarget = new mars3d.BaseClass()

export const mapOptions = {
  scene: {
    center: { lat: 30.606438, lng: 116.329605, alt: 53280, heading: 0, pitch: -60 }
  }
}
/**
 * 初始化地圖業(yè)務(wù),生命周期鉤子函數(shù)(必須)
 * 框架在地圖初始化完成后自動調(diào)用該函數(shù)
 * @param {mars3d.Map} mapInstance 地圖對象
 * @returns {void} 無
 */
export function onMounted(mapInstance) {
  map = mapInstance // 記錄map

  // 創(chuàng)建矢量數(shù)據(jù)圖層
  graphicLayer = new mars3d.layer.GraphicLayer()
  map.addLayer(graphicLayer)

  // 在layer上綁定監(jiān)聽事件
  graphicLayer.on(mars3d.EventType.click, function (event) {
    console.log("監(jiān)聽layer,單擊了矢量對象", event)
  })
  bindLayerPopup() // 在圖層上綁定popup,對所有加到這個圖層的矢量數(shù)據(jù)都生效
  bindLayerContextMenu() // 在圖層綁定右鍵菜單,對所有加到這個圖層的矢量數(shù)據(jù)都生效

  // 加一些演示數(shù)據(jù)
//   addDemoGraphic1(graphicLayer)
  addDemoGraphic2(graphicLayer)
//   addDemoGraphic3(graphicLayer)
//   addDemoGraphic3b(graphicLayer)
//   addDemoGraphic4(graphicLayer)
//   addDemoGraphic5(graphicLayer)
//   addDemoGraphic6(graphicLayer)
//   addDemoGraphic7(graphicLayer)
//   addDemoGraphic8(graphicLayer)
//   addDemoGraphic9(graphicLayer)
//   addDemoGraphic10(graphicLayer)
//   addDemoGraphic11(graphicLayer)
//   addDemoGraphic12(graphicLayer)
//   addDemoGraphic13(graphicLayer)
//   addDemoGraphic14(graphicLayer)
}

/**
 * 釋放當(dāng)前地圖業(yè)務(wù)的生命周期函數(shù)
 * @returns {void} 無
 */
export function onUnmounted() {
  map = null

  graphicLayer.remove()
  graphicLayer = null
}

//
function addDemoGraphic1(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: [116.1, 31.0, 1000],
    style: {
      radii: new Cesium.Cartesian3(1000.0, 1000.0, 1500.0),
      color: "#00ff00",
      opacity: 0.5,

      label: { text: "鼠標(biāo)移入會高亮", pixelOffsetY: -30 },
      // 高亮?xí)r的樣式(默認(rèn)為鼠標(biāo)移入,也可以指定type:'click'單擊高亮),構(gòu)造后也可以openHighlight、closeHighlight方法來手動調(diào)用
      highlight: {
        opacity: 0.9
      }
    },
    attr: { remark: "示例1" }
  })
  graphicLayer.addGraphic(graphic) // 還可以另外一種寫法: graphic.addTo(graphicLayer)

  // 演示個性化處理graphic
  initGraphicManager(graphic)
}
// 也可以在單個Graphic上做個性化管理及綁定操作
function initGraphicManager(graphic) {
  // 3.在graphic上綁定監(jiān)聽事件
  // graphic.on(mars3d.EventType.click, function (event) {
  //   console.log("監(jiān)聽graphic,單擊了矢量對象", event)
  // })
  // 綁定Tooltip
  // graphic.bindTooltip('我是graphic上綁定的Tooltip') //.openTooltip()

  // 綁定Popup
  const inthtml = `<table style="width: auto;">
            <tr>
              <th scope="col" colspan="2" style="text-align:center;font-size:15px;">我是graphic上綁定的Popup </th>
            </tr>
            <tr>
              <td>提示:</td>
              <td>這只是測試信息,可以任意html</td>
            </tr>
          </table>`
  graphic.bindPopup(inthtml).openPopup()

  // 綁定右鍵菜單
  graphic.bindContextMenu([
    {
      text: "刪除對象[graphic綁定的]",
      icon: "fa fa-trash-o",
      callback: (e) => {
        const graphic = e.graphic
        if (graphic) {
          graphic.remove()
        }
      }
    }
  ])

  // 測試 顏色閃爍
  if (graphic.startFlicker) {
    graphic.startFlicker({
      time: 20, // 閃爍時長(秒)
      maxAlpha: 0.5,
      color: Cesium.Color.YELLOW,
      onEnd: function () {
        // 結(jié)束后回調(diào)
      }
    })
  }
}

//
function addDemoGraphic2(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.2, 31.0, 1000),
    style: {
      radii: new Cesium.Cartesian3(1000.0, 1000.0, 1000.0),
      color: Cesium.Color.RED.withAlpha(0.5),
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例2" }
  })
  graphicLayer.addGraphic(graphic) // 還可以另外一種寫法: graphic.addTo(graphicLayer)
  // 設(shè)置自轉(zhuǎn)動畫
    map.viewer.clock.onTick.addEventListener(function(clock) {
    var time = clock.currentTime;
    var multiplier = 1; // 時間流速倍數(shù),可以根據(jù)需要調(diào)整

    // 計(jì)算地球的旋轉(zhuǎn)角度
    var angle = window.Cesium.Math.TWO_PI * multiplier * time.secondsOfDay / 86400;

    // 設(shè)置EllipsoidEntity的旋轉(zhuǎn)角度
    // const a = window.Cesium.Quaternion.fromAxisAngle(window.Cesium.Cartesian3.UNIT_Z, angle);
    graphic.entity.orientation.setValue(window.Cesium.Quaternion.fromAxisAngle(window.Cesium.Cartesian3.UNIT_Z, angle));
    // graphic.orientation = window.Cesium.Quaternion.fromAxisAngle(window.Cesium.Cartesian3.UNIT_Z, angle);
    });
}

function addDemoGraphic3(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.307258, 30.999546, 1239.2),
    style: {
      radii: new Cesium.Cartesian3(2000.0, 2000.0, 2000.0),
      maximumConeDegree: 90,
      materialType: mars3d.MaterialType.EllipsoidElectric,
      materialOptions: {
        color: Cesium.Color.GREEN,
        speed: 5.0
      }
    },
    attr: { remark: "示例3" }
  })
  graphicLayer.addGraphic(graphic) // 還可以另外一種寫法: graphic.addTo(graphicLayer)
}

function addDemoGraphic3b(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.303345, 31.087028, 452.2),
    style: {
      radii: new Cesium.Cartesian3(2000.0, 2000.0, 2000.0),
      maximumConeDegree: 90,
      materialType: mars3d.MaterialType.EllipsoidWave,
      materialOptions: {
        color: "#00ffff",
        speed: 5.0
      }
    }
  })
  graphicLayer.addGraphic(graphic) // 還可以另外一種寫法: graphic.addTo(graphicLayer)
}

//
function addDemoGraphic4(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: [116.4, 31.0, 1000],
    style: {
      radii: new Cesium.Cartesian3(2500.0, 2500.0, 2500.0),
      innerRadii: new Cesium.Cartesian3(10.0, 10.0, 10.0),
      minimumClockDegree: -15.0,
      maximumClockDegree: 15.0,
      minimumConeDegree: 75.0,
      maximumConeDegree: 105.0,
      pitch: 30,
      color: "#f33349",
      opacity: 0.9,
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)",
      label: {
        text: "我是原始的",
        font_size: 18,
        color: "#ffffff",
        pixelOffsetY: -10,
        distanceDisplayCondition: true,
        distanceDisplayCondition_far: 500000,
        distanceDisplayCondition_near: 0
      }
    },
    attr: { remark: "示例4" }
  })
  graphicLayer.addGraphic(graphic)

  // graphic轉(zhuǎn)geojson
  const geojson = graphic.toGeoJSON()
  console.log("轉(zhuǎn)換后的geojson", geojson)
  addGeoJson(geojson, graphicLayer)
}

// 添加單個geojson為graphic,多個直接用graphicLayer.loadGeoJSON
function addGeoJson(geojson, graphicLayer) {
  const graphicCopy = mars3d.Util.geoJsonToGraphics(geojson)[0]
  delete graphicCopy.attr
  // 新的坐標(biāo)
  graphicCopy.position = [116.5, 31.0, 1000]
  graphicCopy.style.label = graphicCopy.style.label || {}
  graphicCopy.style.label.text = "我是轉(zhuǎn)換后生成的"
  graphicLayer.addGraphic(graphicCopy)
}

// 2圈平面扇形
function addDemoGraphic5(graphicLayer) {
  const outerRadius = 5000.0
  const innerRadius = 1000

  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: [116.1, 30.9, 1000],
    style: {
      radii: new Cesium.Cartesian3(outerRadius, outerRadius, outerRadius),
      innerRadii: new Cesium.Cartesian3(innerRadius, innerRadius, innerRadius),
      minimumClockDegree: -20.0,
      maximumClockDegree: 20.0,
      minimumConeDegree: 90,
      maximumConeDegree: 90,
      color: "rgba(255,255,0,0.2)",
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例5" }
  })
  graphicLayer.addGraphic(graphic) // 還可以另外一種寫法: graphic.addTo(graphicLayer)
}

// 半圓頂球體
function addDemoGraphic6(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.2, 30.9, 1000),
    style: {
      radii: new Cesium.Cartesian3(2000.0, 2000.0, 2000.0),
      maximumConeDegree: 90,
      color: Cesium.Color.BLUE.withAlpha(0.3),
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例6" }
  })
  graphicLayer.addGraphic(graphic) // 還可以另外一種寫法: graphic.addTo(graphicLayer)
}

// 含內(nèi)半徑 半圓頂球體
function addDemoGraphic7(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.3, 30.9, 1000),
    style: {
      radii: new Cesium.Cartesian3(2500.0, 2000.0, 1500.0),
      innerRadii: new Cesium.Cartesian3(1000.0, 800.0, 600.0),
      maximumConeDegree: 90,
      color: Cesium.Color.RED.withAlpha(0.3),
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例7" }
  })
  graphicLayer.addGraphic(graphic) // 還可以另外一種寫法: graphic.addTo(graphicLayer)
}

// 被切開的含內(nèi)半徑 半圓頂球體
function addDemoGraphic8(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.4, 30.9, 1000),
    style: {
      radii: new Cesium.Cartesian3(2000.0, 2000.0, 2000.0),
      innerRadii: new Cesium.Cartesian3(1000.0, 1000.0, 1000.0),
      minimumConeDegree: 20.0,
      maximumConeDegree: 90,
      color: Cesium.Color.YELLOW.withAlpha(0.3),
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例8" }
  })
  graphicLayer.addGraphic(graphic) // 還可以另外一種寫法: graphic.addTo(graphicLayer)
}

// 頂部和底部切出的桶形體
function addDemoGraphic9(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.5, 30.9, 1000),
    style: {
      radii: new Cesium.Cartesian3(2000.0, 2000.0, 2000.0),
      innerRadii: new Cesium.Cartesian3(1000.0, 1000.0, 1000.0),
      minimumConeDegree: 60.0,
      maximumConeDegree: 140.0,
      color: "rgba(31,254,230,0.3)",
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例9" }
  })
  graphicLayer.addGraphic(graphic)
}

// 碗行體
function addDemoGraphic10(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.1, 30.8, 1000),
    style: {
      radii: new Cesium.Cartesian3(2000.0, 2000.0, 2000.0),
      innerRadii: new Cesium.Cartesian3(1800.0, 1800.0, 1800.0),
      minimumConeDegree: 110.0,
      color: "rgba(149,228,12,0.3)",
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例10" }
  })
  graphicLayer.addGraphic(graphic)
}

// 時鐘開孔
function addDemoGraphic11(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.2, 30.8, 1000),
    style: {
      radii: new Cesium.Cartesian3(2000.0, 2000.0, 2000.0),
      innerRadii: new Cesium.Cartesian3(1500.0, 1500.0, 1500.0),
      minimumClockDegree: -90.0,
      maximumClockDegree: 180.0,
      minimumConeDegree: 20.0,
      maximumConeDegree: 70.0,
      color: "rgba(149,228,12,0.3)",
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例11" }
  })
  graphicLayer.addGraphic(graphic)
}

// 局部圓頂
function addDemoGraphic12(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.3, 30.8, 1000),
    style: {
      radii: new Cesium.Cartesian3(2000.0, 2000.0, 2000.0),
      minimumClockDegree: -90.0,
      maximumClockDegree: 180.0,
      maximumConeDegree: 90.0,
      color: "rgba(242,250,25,0.3)",
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例12" }
  })
  graphicLayer.addGraphic(graphic)
}

// 部分橢圓體
function addDemoGraphic13(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.4, 30.8, 1000),
    style: {
      radii: new Cesium.Cartesian3(3000.0, 3000.0, 3000.0),
      innerRadii: new Cesium.Cartesian3(700.0, 700.0, 700.0),
      minimumClockDegree: 180.0,
      maximumClockDegree: 400.0,
      maximumConeDegree: 90.0,
      color: "rgba(247,154,44,0.3)",
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例13" }
  })
  graphicLayer.addGraphic(graphic)
}

// 土星綜合對象
function addDemoGraphic14(graphicLayer) {
  const position = new mars3d.LngLatPoint(116.5, 30.8, 1000)
  const graphic = new mars3d.graphic.EllipsoidEntity({
    name: "土星",
    position: position,
    style: {
      radii: new Cesium.Cartesian3(2000.0, 2000.0, 2000.0),
      color: new Cesium.Color(0.95, 0.82, 0.49)
    },
    attr: { remark: "示例14" }
  })
  graphicLayer.addGraphic(graphic)

  const graphicNei = new mars3d.graphic.EllipsoidEntity({
    name: "土星的內(nèi)圈",
    position: position,
    style: {
      radii: new Cesium.Cartesian3(4000.0, 4000.0, 4000.0),
      innerRadii: new Cesium.Cartesian3(3000.0, 3000.0, 3000.0),
      minimumConeDegree: 89.8,
      maximumConeDegree: 90.2,
      color: new Cesium.Color(0.95, 0.82, 0.49, 0.5),
      heading: 30,
      pitch: 30
    }
  })
  graphicLayer.addGraphic(graphicNei)

  const graphicWai = new mars3d.graphic.EllipsoidEntity({
    name: "土星外圈",
    position: position,
    style: {
      radii: new Cesium.Cartesian3(4600.0, 4600.0, 4600.0),
      innerRadii: new Cesium.Cartesian3(4150.0, 4150.0, 4150.0),
      minimumConeDegree: 89.8,
      maximumConeDegree: 90.2,
      color: new Cesium.Color(0.95, 0.82, 0.49, 0.5),
      heading: 30,
      pitch: 30
    }
  })
  graphicLayer.addGraphic(graphicWai)
}

// 生成演示數(shù)據(jù)(測試數(shù)據(jù)量)
export function addRandomGraphicByCount(count) {
  graphicLayer.clear()
  graphicLayer.enabledEvent = false // 關(guān)閉事件,大數(shù)據(jù)addGraphic時影響加載時間

  const bbox = [116.984788, 31.625909, 117.484068, 32.021504]
  const result = mars3d.PolyUtil.getGridPoints(bbox, count, 30)
  console.log("生成的測試網(wǎng)格坐標(biāo)", result)

  const radius = result.radius

  for (let j = 0; j < result.points.length; ++j) {
    const position = result.points[j]
    const index = j + 1

    const graphic = new mars3d.graphic.EllipsoidEntity({
      position: position,
      style: {
        radii: new Cesium.Cartesian3(radius, radius, radius),
        color: Cesium.Color.fromRandom({ alpha: 0.6 })
      },
      attr: { index: index }
    })
    graphicLayer.addGraphic(graphic)
  }

  graphicLayer.enabledEvent = true // 恢復(fù)事件
  return result.points.length
}

// 開始繪制
export function startDrawGraphic() {
  graphicLayer.startDraw({
    type: "ellipsoid",
    style: {
      color: "rgba(0,255,255,0.6)"
    }
  })
}

// 在圖層綁定Popup彈窗
export function bindLayerPopup() {
  graphicLayer.bindPopup(function (event) {
    const attr = event.graphic.attr || {}
    attr["類型"] = event.graphic.type
    attr["來源"] = "我是layer上綁定的Popup"
    attr["備注"] = "我支持鼠標(biāo)交互"

    return mars3d.Util.getTemplateHtml({ title: "矢量圖層", template: "all", attr: attr })
  })
}

// 綁定右鍵菜單
export function bindLayerContextMenu() {
  graphicLayer.bindContextMenu([
    {
      text: "開始編輯對象",
      icon: "fa fa-edit",
      show: function (e) {
        const graphic = e.graphic
        if (!graphic || !graphic.hasEdit) {
          return false
        }
        return !graphic.isEditing
      },
      callback: (e) => {
        const graphic = e.graphic
        if (!graphic) {
          return false
        }
        if (graphic) {
          graphicLayer.startEditing(graphic)
        }
      }
    },
    {
      text: "停止編輯對象",
      icon: "fa fa-edit",
      show: function (e) {
        const graphic = e.graphic
        if (!graphic || !graphic.hasEdit) {
          return false
        }
        return graphic.isEditing
      },
      callback: (e) => {
        const graphic = e.graphic
        if (!graphic) {
          return false
        }
        if (graphic) {
          graphic.stopEditing()
        }
      }
    },
    {
      text: "刪除對象",
      icon: "fa fa-trash-o",
      show: (event) => {
        const graphic = event.graphic
        if (!graphic || graphic.isDestroy) {
          return false
        } else {
          return true
        }
      },
      callback: (e) => {
        const graphic = e.graphic
        if (!graphic) {
          return
        }
        const parent = graphic.parent // 右擊是編輯點(diǎn)時
        graphicLayer.removeGraphic(graphic)
        if (parent) {
          graphicLayer.removeGraphic(parent)
        }
      }
    }
  ])
}

Mars3d采用ellipsoid球?qū)崿F(xiàn)模擬地球旋轉(zhuǎn)效果,Mars3d,vue,app,3d,javascript,開發(fā)語言

?

4.采用屬性機(jī)制即可實(shí)現(xiàn)球體模擬地球旋轉(zhuǎn)的效果:

采用屬性機(jī)制即可文章來源地址http://www.zghlxwxcb.cn/news/detail-572240.html

 function addDemoGraphic2(graphicLayer) {
  const graphic = new mars3d.graphic.EllipsoidEntity({
    position: new mars3d.LngLatPoint(116.2, 31.0, 1000),
    style: {
      radii: new Cesium.Cartesian3(1000.0, 1000.0, 1000.0),
      color: Cesium.Color.RED.withAlpha(0.5),
      outline: true,
      outlineColor: "rgba(255,255,255,0.5)"
    },
    attr: { remark: "示例2" }
  })
  graphicLayer.addGraphic(graphic) // 還可以另外一種寫法: graphic.addTo(graphicLayer)

  // 設(shè)置自轉(zhuǎn)動畫
  let angle
  map.on(mars3d.EventType.clockTick, function (clock) {
    angle = (Cesium.Math.TWO_PI * clock.multiplier * clock.currentTime.secondsOfDay) / 86400 // 計(jì)算旋轉(zhuǎn)角度
  })
  graphic.entity.orientation = new Cesium.CallbackProperty((time) => {
    return Cesium.Quaternion.fromAxisAngle(Cesium.Cartesian3.UNIT_Z, angle)
  }, false)

}

到了這里,關(guān)于Mars3d采用ellipsoid球?qū)崿F(xiàn)模擬地球旋轉(zhuǎn)效果的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(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)文章

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

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

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

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

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

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

    2024年02月15日
    瀏覽(26)
  • Vue2項(xiàng)目使用mars3d

    或參考webpack.config.js寫法進(jìn)行修改

    2024年02月14日
    瀏覽(57)
  • Mars3D/Cesium + VUE3

    不定期更新 參考官網(wǎng): http://mars3d.cn/dev/guide/start/import.html#_3-3-vite-%E6%8A%80%E6%9C%AF%E6%A0%88%E6%97%B6-%E7%9A%84%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE%E4%BF%AE%E6%94%B9 :已親測vite框架,可以運(yùn)行,具體見下main 1、插件 vite-plugin-mars3d vite中需要

    2024年02月14日
    瀏覽(31)
  • vue3 mars3d 天地圖

    ????????????????npm i?mars3d? ????????????????npm i mars3d-heatmap (熱力圖,需要的話安裝) ????????????????npm i -D?copy-webpack-plugin ????????????????增加mars3d目錄配置,修改vue.config.js中configureWebpack里的內(nèi)容如下: ?使用: 最后附上天地圖mapUrl地址

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

    Mars3D Studio 的使用方法

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

    2023年04月16日
    瀏覽(30)
  • Mars3d項(xiàng)目啟動上的一些坑

    Mars3d項(xiàng)目啟動上的一些坑

    最近新入職了一家公司,公司新開了有個未來城市的項(xiàng)目,需要用到3D城市建模,公司老總選了Mars3d作為前端框架,項(xiàng)目分給我了,又是一個全新的領(lǐng)域,開搞吧! 下面是自己遇到的幾個小問題,記錄一下: 1 npm install copy-webpack-plugin --save -dev 時報錯 解決辦法:npm install cop

    2024年02月05日
    瀏覽(28)
  • [mars3d 學(xué)習(xí)] 最近升級版本造成的問題

    [mars3d 學(xué)習(xí)] 最近升級版本造成的問題

    1、mars3d升級3.5以上,使用的時候報錯; 需要看下?Mars3D三維可視化平臺 | 火星科技?版本更新日志; 使用將Cesium的版本升級到1.103 2、升級Cesium到1.103,之后打包又會報錯 -?error in ./node_modules/mars3d-Cesium/Build/Cesium/index.js 哦,是因?yàn)閏esium1.96改變了代碼打包方式;在vue2中就會存在

    2024年02月17日
    瀏覽(49)
  • Mars3D使用過程遇到的問題記錄【持續(xù)更新】

    需要標(biāo)注線面的角度heading 2022年6月23日 heading計(jì)算方式: https://turfjs.fenxianglu.cn/ 計(jì)算兩點(diǎn)之間的角度 直接F12在控制臺可以計(jì)算 eg: 加載gltf模型,模型是透明的,需要改為不透明 2022年6月23日 用文本編輯器打開.gltf,把里面的\\\"alphaMode\\\":\\\"BLEND\\\"改成\\\"alphaMode\\\":\\\"OPAQUE\\\" 模型旋轉(zhuǎn)之后,標(biāo)

    2024年02月08日
    瀏覽(30)
  • vue3+vite項(xiàng)目集成mars3d

    創(chuàng)建一個項(xiàng)目 yarn create vite // vue - ts 安裝依賴 yarn add?vite-plugin-mars3d -D yarn add?mars3d 控制臺警告 warning \\\" mars3d@3.5.0\\\" has unmet peer dependency \\\"@turf/turf@^6.5.0\\\". warning \\\" mars3d@3.5.0\\\" has unmet peer dependency \\\"mars3d-cesium@~1.103.1\\\". 安裝 yarn add? @turf/turf?mars3d-cesium 修改 vite.config.ts 修改srcApp.vue 就可

    2024年02月15日
    瀏覽(31)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

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

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包