【问题标题】:add a polygon to Harp using Lon,Lat使用 Lon,Lat 将多边形添加到 Harp
【发布时间】:2020-08-14 14:47:36
【问题描述】:

下面的 Harp 示例使用屏幕位置和一些“未知”测量单位将多边形添加到地图中。如何根据形状的 lon/Lat 和以米为单位的高度添加多边形?

 //Create the three.js cube
   const geometry = new THREE.BoxGeometry(100, 100, 100);
   const material = new THREE.MeshStandardMaterial({ color: 0x00ff00fe });
   const cube = new THREE.Mesh(geometry, material);
   cube.renderOrder = 100000;

   //Get the position of the click
   const geoPosition = map.getGeoCoordinatesAt(evt.pageX, evt.pageY);
   cube.geoPosition = geoPosition;

   //Add object to the map
   map.mapAnchors.add(cube);
   map.update();

【问题讨论】:

    标签: geospatial polygon harp


    【解决方案1】:

    mapAnchors API 用于向地图添加三个.js 对象。

    如果您想添加地理多边形,您可以通过 GeoJSON 或 FeatureDataSource(实际上只是 geojson 之上的一个便利包装器)来完成。

    请参阅以下示例:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-16
      • 2018-09-05
      • 1970-01-01
      • 1970-01-01
      • 2018-02-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多