帖子
帖子
用户
博客
课程
123下一页
返回列表 发新帖
50
帖子
2
勋章
1327
Y币
是不是和百度申请的key有关
20
帖子
1
勋章
7581
Y币
Shawn Chen 发表于 2018-12-12 12:43
传和不传都试过 效果一样 而且文档说明不传就默认night

文档上没告诉你不传就默认night,文档告诉你configPath和customConfig是其中之一可选,你一个都不选哪来night?选了customConfig,才有customConfig下面的默认night。
2
帖子
0
勋章
16
Y币
常山赵子云 发表于 2018-12-12 16:27
文档上没告诉你不传就默认night,文档告诉你configPath和customConfig是其中之一可选,你一个都不选哪来n ...

首先我的回复中说了 传和不传都试过 结果一样

然后 文档中的
示例代码:
var bMap = api.require('bMap');
bMap.customStyle();

请问他选择了什么呢?

最后 如果我传了customConfig 又不指定值. 请问这要怎么写?
bMap.customStyle({customConfig :""});
这样写吗? 如果不会这样写,那这个默认值又有什么意义?

不咬文嚼字了 解决问题最终要 谢谢
20
帖子
1
勋章
7581
Y币
bMap.customStyle({customConfig :"night"});
2
帖子
0
勋章
16
Y币
本帖最后由 Shawn Chen 于 2018-12-13 09:08 编辑
常山赵子云 发表于 2018-12-12 18:19
bMap.customStyle({customConfig :"night"});

注释的2行代码 打开 地图就出不来 关闭地图就正常

麻烦确认一下

如果你们测试通过了 麻烦告诉我一下我的代码哪里有问题

var map = api.require('bMap');

//map.customStyle({customConfig :"night"});
var openMap = function(center) {
    map.open({
        rect: {
            x: 0,
            y: 0,
            w: "auto",
            h: "auto"
        },
        center: center,
        zoomLevel: 14,
        showUserLocation: true,
        fixedOn: api.frameName,
        fixed: true
    }, function(ret) {
        if (ret.status) {
            //map.enableCustom();
            map.setScaleBar({
                show: true,
                position: {
                    x: 100,
                    y: 100
                }
            });
        }
    });
}

map.getLocation({
    accuracy: '100m',
    autoStop: true,
    filter: 1
}, function(ret, err) {
    if (ret.status) {
        openMap({
            lon: ret.lon,
            lat: ret.lat,
        });
    } else {
        alert(err.code);
    }
});


2
帖子
0
勋章
16
Y币
VvVv1o 发表于 2018-12-12 13:08
是不是和百度申请的key有关

AK没有问题 不用自定义样式 地图一切正常
2
帖子
0
勋章
16
Y币
gigie 发表于 2018-12-12 11:20
嗯,我测试一下。

请问测试有结果了吗?~
175
帖子
1
勋章
5678
Y币
换其他颜色试试
175
帖子
1
勋章
5678
Y币
已经反馈,耐心等待
1
帖子
1
勋章
4276
Y币
你好,把之前的apk卸载,然后在平台重新编译打包试一下,因为今天有更新过
123下一页
您需要登录后才可以回帖 登录

本版积分规则