|
我来告诉你:
map.open({
x : 0,
y : topHeight,
lon : myPosition.lon,
lat : myPosition.lat,
width : rect_w,
height : rect_h,
fixedOn : "hotelMap_body",
}, function(ret, err) {
if (ret.status) {
//map.setType({type:'satellite'});
map.setScrollEnable({enable:true});
//在地图上添加一个可重新定位自己的图片按钮//////////////////
api.openFrame({
name:'relocation',
url:'relocation.html',
rect:{
x:2,
y:110,
w:400,
h:60
},
bounces:false
});
relocation.html:
...
<body>
<div class="" onclick="relocation()">
<img src="../../images/relocation.png">
</div>
</body>
<script type="text/javascript" src="api.js"></script>
<script type="text/javascript">
apiready = function(){
};
function relocation() {
api.confirm({
title: '提示',
msg: '需要重新定位吗',
buttons:['确定', '取消']
},function(ret,err){
if(ret.buttonIndex == 1){
api.execScript({
name: '',
frameName: 'hotelMap_body',
script: 'relocation()' //hotelMapShow.html:relocation
});
}
});
}
</script>
</html> |
|