百度地图个性化地图V2,报Cannot read property 'parentElement' of undefined错误
做一个项目过程使用到百度地图个性化地图,使用方法map.setMapStyleV2({styleJson:styleJson});
报错:Cannot read property ‘parentElement’ of undefined,参考了链接https://blog.csdn.net/u013455430/article/details/80528931把该方法移至最后依然无效,几经周折终于找到坑点所在://map.centerAndZoom(“杭州市”,12);——不能用,必须使用坐标点
修改为map.centerAndZoom(new BMap.Point(120.219375416,30.2592444615),12)后map.setMapStyleV2({styleJson:styleJson})生效