|
本帖最后由 后来者…… 于 2017-11-23 15:23 编辑
首先感谢各位大神的指导!
综上所述,完成地图上做导航。首先,打开地图,然后在回调函数里打开另一个页面,在这个页面做导航。注意:在顶层页面设置页面背景为透明。
apiready = function(){
var bMap = api.require("bMap");
bMap.open({
rect: {
x: 0,
y: $api.dom('header').offsetHeight,
w: $api.dom('#main').offsetWidth,
h: $api.dom('#main').offsetHeight
},
center: {
lon: 116.4021310000,
lat: 39.9994480000
},
zoomLevel: 10,
showUserLocation: true,
fixedOn: api.frameName,
fixed: true
}, function(ret){
if(ret.status){
api.openFrame({
name: 'navs',
url: './html/navs.html',
rect: {
x: 0,
y: $api.dom('header').offsetHeight,
w: $api.dom('#main').offsetWidth,
h: $api.dom('#main').offsetHeight
},
pageParam: {
name: 'navs'
},
bounces: false,
bgColor: 'rgba(0,0,0,0)',
vScrollBarEnabled: true,
hScrollBarEnabled: true
});
}
});
navs.html css : html,body{background-color:transparent;}如果将api.css 文件里对页面背景的样式去掉,bgColor参数会生效。
bgColor参数默认值:若在 config.xml 里面配置了 frameBackgroundColor,则默认值为配置的值,否则透明。
|
|