wang某
wang某
  • 发布:2023-05-10 10:54
  • 更新:2023-05-10 10:54
  • 阅读:158

【报Bug】云打包, 地图不显示

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: windows11

HBuilderX类型: 正式

HBuilderX版本号: 3.7.11

手机系统: Android

手机系统版本号: Android 12

手机厂商: 华为

手机机型: 荣耀X30

页面类型: nvue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<template> <view style="background-color: white;"> <map id="myMap" class="myMap" :scale="scale" show-location show-compass :enable-satellite="true" :max-scale="18" latitude="latitude" :longitude="longitude" :markers="marks" :polyline="polyline"

style="'height:'+windowHeight*3.3+'rpx;width: 100%;'">

    <cover-view class="my_add">  
        <cover-image class="img_add" src="../../static/image/add_danger.png" @click="toAddDanger"></cover-image>  
    </cover-view>  

    <cover-view class="my_location">  
        <cover-image class="img" src="../../static/image/locator.png" @click="pitch"></cover-image>  
    </cover-view>  
</map>  
<view style="background: #fff;height:200px;">  
    <view style="align-items:center;margin-top: 20px;">  
        <view v-if="flag" class="mbuttonA" @click="startBt">  
            <text style="font-size: 30px;color: #fff;">开始巡查</text>  
        </view>  
        <view v-if="flag===false" class="mbuttonB" @click="end">  
            <text style="font-size: 30px;color: #fff;">结束巡查</text>  
        </view>  
    </view>  
</view>  

</view>
</template>
//地标 转 国测 常量
var x_PI = (3.14159265358979324 * 3000.0) / 180.0;
var PI = 3.1415926535897932384626;
var a = 6378245.0; //卫星椭球坐标投影到平面地图坐标系的投影因子。
var ee = 0.00669342162296594323; //椭球的偏心率。

var mLocatinService = uni.requireNativePlugin("Wwei-LocationService")

import http from '../../common/http.js'
import params from '../../common/params.js'
import utils from '../../common/util.js'

onShow() {
//创建map实例
this.mapContext = uni.createMapContext("myMap", this);
this.windowHeight = uni.getSystemInfoSync().screenHeight;
this.scale = 16

},  

onLoad(options) {

    let that = this  
    if (options.item != null) {  
        let item = JSON.parse(decodeURIComponent(options.item));  
        console.log(item)  
        that.id = item.id  
        that.status = item.status.toString()  
        if (that.status == '1') {  
            that.flag = false  
            that.timer = setInterval(() => {  

                //自身定位  
                that.pitch()      
                mLocatinService.getLocation({}, (res) => {  
                    console.log('获取插件信息:' + JSON.stringify(res))  
                    console.log('当前位置的经度:' + JSON.stringify(res.longti));  
                    console.log('当前位置的纬度:' + JSON.stringify(res.lat));  

                    let longti = JSON.stringify(res.longti)  
                    let lat = JSON.stringify(res.lat)  

                    if (lat != '5e-324' && lat > 0) {  
                        http.uploadTrack({  
                            taskId: that.id,  
                            lng: longti,  
                            lat: lat,  
                            // createTime: time  
                        }, that.token).then(res => {  
                            console.log(res)  
                        })  
                    }  

                })  

            }, 5000);  
        }  
    }  

},

操作步骤:

进入地图界面 地图一直不显示

预期结果:

nvue 界面 地图 在uni-app编译模式下可以 显示

实际结果:

nvue 界面 地图 在uni-app编译模式下 不显示 显示

bug描述:

云打包后, 地图不显示。 自定义调试基座和weex编译模式下 地图可以显示 但是uni-app 编译模式下 地图不显示, 高德地图的可以也配置好了, 云端证书也试了也不行。

2023-05-10 10:54 负责人:无 分享
已邀请:

要回复问题请先登录注册