• uni-app 地图初用 map


    一、uni-app 地图初用 map

    代码如下:

    <template>
        <view>
            <!-- <page-head :title="title"></page-head> -->
            <view class="uni-common-mt">
                <view>
                    <map :latitude="latitude" :longitude="longitude" :markers="markers" :polyline="polyline" >
                    <cover-view class="test">我是测试的</cover-view>
                    </map>
                </view>
            </view>
        </view>
    </template>
    <script>
        export default {
            data() {
                return {
                    title: 'map',
                    latitude: 39.909,
                    longitude: 116.39742,
                    markers: [{
                        title:'我在哪,我在哪',
                        latitude: 39.9085,
                        longitude: 116.39747,
                        iconPath: '../../static/location@3x.png',
                        label:{
                            content:'文本1',
                            color:'#F76350',
                            bgColor:'#fff',
                            padding:5,
                            borderRadius:4
                        },
                        callout:{
                            content:'广州啊',
                            color:'#F76350',
                            fontSize:12
                        }
                    }, {
                        latitude: 39.90,
                        longitude: 116.39,
                        iconPath: '../../static/location@3x.png',
                        title:'故宫',
                        label:{
                            content:'文本2',
                            color:'#F76350',
                            bgColor:'#fff',
                            padding:5,
                            borderRadius:4
                        },
                        callout:{
                            content:'北京啊',
                            color:'#F76350',
                            fontSize:12    
                        }
                    }],
                    polyline:[
                        {
                        'points':[{latitude: 39.9085, longitude: 116.39747},{latitude: 39.90, longitude: 116.39}],
                         color:'#000000 ',
                         3
                    }],
                }
            },
            methods: {
    
            }
        }
    </script>
    <style>
        map {
             100%;
            height: 800upx;
        }
        .test{
            background: #fff;
            height: 100upx;
            text-align: center;
            display: flex;
            margin: 30upx;
        }
    </style>

    代码分析

    效果提:

  • 相关阅读:
    最大生成树
    Codeforces#363 Div2
    AOJ2249最短路+最小费用
    Codeforces#364Div2
    POJ3268Dijkstra
    POJ3259负环判定
    Codeforces#362
    POJ3169差分约束系统
    POJ3723最小生成树
    hdu 4038 2011成都赛区网络赛H 贪心 ***
  • 原文地址:https://www.cnblogs.com/qinmanyu/p/10109781.html
Copyright © 2020-2023  润新知