0

下面的 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();
4

1 回答 1

0

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

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

请参阅以下示例:

于 2020-08-18T20:29:18.347 回答