PilotGaea 3D O'view
    正在準備搜尋索引...

    類別 CustomLayer

    自畫圖層

    索引

    方法

    • 產生自畫群集圖素。

      參數

      回傳 CustomClusterEntity

      圖素物件。

      const label = {
      text: "文字",
      color: new ov.Color("#FFFFFF"),
      font: "微軟正黑體",
      size: 16,
      borderColor: new ov.Color("#000000"),
      borderSize: 3,
      };
      const children = [
      {geo, absHeight, ..., children:[]},
      //...參考param
      {geo, absHeight, ..., children:[]}
      ];
      const param = {
      geo: new GeoPoint(123, 25),
      absHeight: false,
      epsg: 4326,
      label,
      labelOffset: new GeoPoint(0, 0),
      symbol: "http://127.0.0.1/m1.png",
      size: 16,
      minDispHeight: 5000,
      maxDispHeight: 20000,
      displayLeafCount: true,
      attr: "點擊資訊",
      childrenCluster: false,
      childrenGridSize: 32,
      childrenMaxSize: 0,
      children,
      };
      const cluster = customLayer.addClusterEntity(param);
    • 產生自畫圓錐圖素。

      參數

      回傳 window.ov.CustomConeEntity

      圖素物件。

      const param = {
      geo = new GeoPoint(122.498026, 24.968293, 1000000),
      direction = new Geo3DPoint(1, 1, -1),
      distance = 4000000,
      radius = 1000000,
      color = new ov.Color("#FFE800"),
      opacity = 0.5,
      };
      const cone = customLayer.addConeEntity(param);
    • 產生自畫人手孔圖素。

      參數

      回傳 window.ov.CustomManholeEntity

      圖素物件。

      const param = {
      geo: new GeoPoint(121, 22), // 幾何
      color: new ov.Color("#FFFFFF"),
      image: "hole.png",
      width: 10.0,
      height: 0.0,
      depth: 10,
      bulge: 0.1,
      absHeight: true,
      };
      const manhole = customLayer.addManholeEntity(param);
    • 產生自畫點圖素。

      參數

      回傳 window.ov.CustomPointEntity

      圖素物件。

      const param = {
      geo: new GeoPoint(122, 23, 300),
      color: new ov.Color("#FF0000"),
      opacity: 1.0,
      size: 32,
      epsg: 4326,
      absHeight: true,
      label: {
      color:new ov.Color("#00FF00"),
      text:"測試文字",
      font:"微軟正黑體",
      size:20,
      borderColor:new ov.Color("#000000"),
      borderSize:1
      }, // 加上文字Label
      symbol: "symbol.png"
      };
      const pointEntity = customLayer.addPointEntity(param);
    • 產生自畫多邊形柱體圖素。

      參數

      回傳 window.ov.CustomPolygonPrismEntity

      圖素物件。

      const param = {
      geo: new GeoPolygonSet(new GeoPolygon([new GeoPoint(121, 22), new GeoPoint(122, 23), new GeoPoint(122, 22)])),
      surfaceHeight: 500,
      height: 500,
      epsg: 4326,
      color: new ov.Color("#FF0000"),
      drawBorder: true,
      borderColor: new ov.Color("#FFFFFF"),
      };
      const polygonPrism = customLayer.addPolygonPrismEntity(param);
    • 產生自畫Projector攝影機圖素。

      參數

      回傳 window.ov.CustomProjectorEntity

      圖素物件。

      const param = {
      ImageType: ov.PROJECTOR_IMAGE.NORMAL,
      SrcType: ov.PROJECTOR_SRC.VIDEO,
      VideoPath: "test.mp4",
      Pos: new GeoPoint(120.68, 24.12, 74.36),
      V: new Geo3DPoint(0.16, 0.94, -0.29),
      Up: new Geo3DPoint(0.05, 0.29, 0.95),
      VFov: 45,
      HFov: 65,
      Far: 1000,
      Near: 5,
      WallOpacity: 1,
      VideoOpacity: 1,
      MinPlaneHeight: 0,
      MinDisplayDistance: 0,
      MaxDisplayDistance: 0,
      ShowFovLine: true,
      FovLineColor: new ov.Color("#FF0000"),
      DistortionParamA: 0,
      DistortionParamB: 0,
      DistortionParamC: 0,
      DistortionScale: 1,
      ImgW: 512,
      ImgH: 512,
      CenterX: 0.5,
      CenterY: 0.5,
      FisheyeRadiusXRate: 0.5,
      FisheyeRadiusYRate: 0.5,
      };
      const projector = customLayer.addProjectorEntity(param);
    • 產生自畫圖釘圖素。

      參數

      回傳 window.ov.CustomPushpinEntity

      const param = {
      geo: new GeoPoint(1, 2, 3),
      color: new ov.Color("#FF0000"),
      text: "測試文字",
      font: "新細明體",
      size: 14,
      epsg: 4326,
      borderColor: new ov.Color("#000000"),
      borderSize: 4,
      pullUpY: 100,
      opacity: 1.0,
      symbol: "pin.png"
      };
      const pushpin = customLayer.addPushpinEntity(param);
    • 產生自畫球體圖素。

      參數

      回傳 window.ov.CustomSphereEntity

      圖素物件。

      const param = {
      geo: new GeoPoint(120.5, 23, 1000),
      color: new ov.Color("#FF0000"),
      opacity: 1,
      radius: 1,
      epsg: 4326,
      mode: "uv",
      sphereDetail: 30,
      lineMode: false,
      absHeight: true,
      };
      const sphere = customLayer.addSphereEntity(param);
    • 產生自畫三角網格圖素。

      參數

      回傳 window.ov.CustomTriangleSetEntity

      圖素物件。

      const triA = [
      new GeoPoint(120.18, 22.99, 70),
      new GeoPoint(120.18, 22.99, 60),
      new GeoPoint(120.19, 22.99, 60)
      ];
      const triB = [
      new GeoPoint(120.19, 22.99, 60),
      new GeoPoint(120.19, 22.99, 70),
      new GeoPoint(120.18, 22.99, 70)
      ];
      const param = {
      geo: [triA, triB],
      drawLines: false,
      drawColor: new ov.Color("#FF0000"),
      fillColor: new ov.Color("#EBEBEB"),
      texture: "rock.jpg";
      fillOpacity: 1,
      drawOpacity: 1,
      epsg: 4326,
      triangleTp: [
      [new GeoPoint(0, 0), new GeoPoint(0, 1), new GeoPoint(1, 1)],
      [new GeoPoint(1, 1), new GeoPoint(1, 0), new GeoPoint(0, 0)]
      ];
      };
      const triangleSet = customLayer.addTriangleSetEntity(param);
    • 移除全部圖素。

      回傳 boolean

      是否移除成功。

    • 移除圖素。

      參數

      回傳 boolean

      是否移除成功。

    • 設置自畫圖層深度測試的方式。

      參數

      回傳 boolean

      是否設置成功。

    • 設置自畫圖層是否要在作圖時開啟深度測試。

      參數

      • depthTest: boolean

        是否開啟深度測試。

      回傳 boolean

      是否設置成功。

    • 設置自畫圖層不透明程度。

      參數

      • opacity: number

        自畫圖層不透明程度(0~1)。

      回傳 boolean

      是否設置成功。

    訪問器屬性

    • get enableShadow(): boolean

      是否顯示陰影,若 ov.TerrainView 關閉陰影則不會顯示

      回傳 boolean

    • get name(): string

      圖層名稱

      回傳 string

    • get show(): boolean

      是否顯示圖層。

      回傳 boolean