代码
import * as mapvthree from '@baidumap/mapv-three';

mapvthree.BaiduMapConfig.ak = '您的密钥';

new mapvthree.Engine(document.getElementById('map'), {
  map: {
    provider: new mapvthree.BaiduVectorTileProvider(),
    center: [120.145, 30.248],
    range: 3600,
    pitch: 34,
    heading: 35,
  },
  widgets: {
    compass: {
      enabled: true,
    },
  },
});

点击两侧可旋转视图,点击上下箭头可改变俯仰角,点击中心可恢复正北。

预览