代码
import {BaiduMapConfig, BaiduVectorTileProvider, Engine} from '@baidumap/mapv-three';

BaiduMapConfig.ak = '您的密钥';

const container = document.getElementById('map');
// 窄屏时拉远镜头,让中国东西两侧都进入视野。
const aspect = container.clientWidth / container.clientHeight;

new Engine(container, {
  map: {
    projection: 'EPSG:4978',
    center: [104, 35],
    pitch: 0,
    range: 9_600_000 / Math.min(1.45, aspect),
    provider: new BaiduVectorTileProvider(),
  },
});

从中国上空观察贴合地球表面的百度矢量底图,拖动可查看周边区域。

预览