我在以米为单位的坐标系中有一个 3D 模型。坐标已被转换为以模型边界框的中心为原点。因此,坐标为 (1, 0, 0) 的顶点距离原点 1 米。
当尝试将几何图形添加到地图时,以原点的实际纬度/经度作为 geoPosition,它们不会被放置在确切的位置并且看起来比它们小。我怎么能解决这个问题?
谢谢。
您可以使用以下方法将地图居中于世界上任何您想要的位置:
map.setCameraGeolocationAndZoom(
//Singapore coordinates and zoom level 16:
new harp.GeoCoordinates(1.278676, 103.850216), 16
);
您可以在 MapView 的构造函数中指定投影类型。
要实现地球投影:
const map = new harp.MapView({
canvas,
theme: "https://unpkg.com/@here/harp-map-theme@latest/resources/berlin_tilezen_base_globe.json",
projection: harp.sphereProjection,
//For tile cache optimization:
maxVisibleDataSourceTiles: 40,
tileCacheSize: 100
});
//And set it to a view where you can see the whole world:
map.setCameraGeolocationAndZoom(new harp.GeoCoordinates(1.278676, 103.850216), 4);
请参阅文档以获取更多参考: