pyt
2025-02-24 5ddaaed2cf8fe976e5196d0343c8d7add41709d3
引入百度地图
3个文件已修改
25 ■■■■■ 已修改文件
H5/index.html 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/manifest.json 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/location/location.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/index.html
@@ -9,17 +9,15 @@
                '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
                (coverSupport ? ', viewport-fit=cover' : '') + '" />')
        </script>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        </script>
        <title></title>
        <!--preload-links-->
        <!--app-context-->
    </head>
    <body>
        <link rel="stylesheet" href="<%= BASE_URL %>static/index.css"/>
        <div id="app"><!--app-html--></div>
        <script type="module" src="/main.js"></script>
        <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=3mHKIXMArjgIkgADzOlTYp4XssNSNkwr"></script>
    </body>
</html>
H5/manifest.json
@@ -68,5 +68,8 @@
    "uniStatistics" : {
        "enable" : false
    },
    "vueVersion" : "2"
    "vueVersion" : "2",
    "h5" : {
        "template" : "index.html"
    }
}
H5/pages/location/location.vue
@@ -5,8 +5,9 @@
                <image src="/static/location/back.png" class="w-19 h-35" mode=""></image>
            </view>
        </u-navbar>
    <web-view src="https://api.map.baidu.com/api?v=3.0&ak=W3x8DhCWKc2UFIwYgclpRBdL6BeGLLQt"></wwb-view>
        <view class="" id="container">
        </view>
        <view class="">
            <view class="searchMain mb-35">
                <view class="search fs-27 ">
@@ -38,12 +39,19 @@
                longitude: 116.39742,
            };
        },
        mounted() {
         
        },
         onReady() {
             var map = new BMapGL.Map("container");          // 创建地图实例
             var point = new BMapGL.Point(116.404, 39.915);  // 创建点坐标
             map.centerAndZoom(point, 15);
         }
    }
</script>
<style lang="scss" scoped>
    #baiduMap {
    #container {
        width: 100vw;
        height: 517rpx;
    }