var em=null,map=null;
var yhlng;
var yhlat;
// H5 plus事件处理
function plusReady(){
// 确保DOM解析完成
if(!em||!window.plus||map){return};
map = new plus.maps.Map("allmap");
map.centerAndZoom( new plus.maps.Point
(116.3977,39.906016), 12 );
}
if(window.plus){
plusReady();
}else{
document.addEventListener
("plusready",plusReady,false);
}
// DOMContentloaded事件处理
document.addEventListener("DOMContentLoaded",function(){
em=document.getElementById("allmap");
plusReady();
},false);
// 获取用户的当前位置信息
function getUserLocation(){
map.getUserLocation( function ( state, point ){
if( 0 == state ){
yhlng=point.longitude;
yhlat=point.latitude;
if(yhlng!=0&&yhlat!=0){
xiugaiJWD();
}
}else{
alert( "Failed!" );
}
} );
}
setInterval(function(){
getUserLocation();
},15000);
0 个回复