显示源代码
设置镜头位置
 开发文档
            <!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <script src="http://bigemap.com/offline_data/newjunbiao/vue.js"></script>
        <link
            href="http://ua.bigemap.com:30081/bmsdk/bigemap-gl.js/v1.1.0/Widgets/widgets.css"
            rel="stylesheet"
        />
        <script src="http://ua.bigemap.com:30081/bmsdk/bigemap-gl.js/v1.1.0/bigemap-gl.js"></script>
        <!-- elementui -->
        <script src="http://bigemap.com/offline_data/newjunbiao/elementui.js"></script>
        <link rel="stylesheet" href="http://bigemap.com/offline_data/newjunbiao/elementui.css" />
        <title>设置镜头位置</title>
        <style>
            * {
                margin: 0;
                padding: 0;
            }
            html,
            body {
                width: 100%;
                height: 100%;
            }
            #app {
                width: 100%;
                height: 100%;
            }
            #baseMap {
                width: 100%;
                height: 100%;
            }
            .tools {
                position: absolute;
                z-index: 9;
                top: 40px;
                right: 60px;
                width: 200px;
                height: 40px;
                display: flex;
                align-items: center;
            }
        </style>
    </head>
    <body>
        <div id="app">
            <div id="baseMap"></div>
        </div>
        <script>
            let viewer = null;
            window.onload = () => {
                new Vue({
                    el: "#app",
                    data() {
                        return {};
                    },
                    mounted() {
                        this.initMap();
                    },
                    methods: {
                        //初始化地图
                        initMap() {
                            bmgl.Config.HTTP_URL = "http://ua.bigemap.com:30081/bmsdk/";
                            viewer = new bmgl.Viewer("baseMap", {
                                mapId: "bigemap.dc-tian-w-satellite",
                                infoBox: false,
                                selectionIndicator: false,
                            });
                            this.setCameraPos(viewer);
                        },
                        //设置镜头位置
                        setCameraPos(viewer) {
                            viewer.camera.setView({
                                // 设置镜头的所在位置的经纬度和高度
                                destination: bmgl.Cartesian3.fromDegrees(
                                    104.5,
                                    30.6,
                                    40000
                                ),
                                // 设置镜头的偏转角
                                orientation: {
                                    heading: 0,
                                    pitch: bmgl.Math.toRadians(-45),
                                    roll: 0,
                                },
                            });
                        },
                    },
                    beforeDestroy() {
                        viewer.destroy();
                        viewer = null;
                    },
                });
            };
        </script>
    </body>
</html>