高德地图LBS JS加载
------------------------------------------------------------UI---------------------------------------------------
逆地理编码.mui-bar{
background:#5ab2e0;
}
.mui-title{
color:#FFFFFF;
}
footer{
text-align: center;
}
.mui-content{
height: 100%;
}
#mapContainer{
top: 0;
left: 0;
position: relative;
min-height:200px;
}
#scrollPos{
position: relative;
min-height: 200px;
}
.mui-table-view-cell{
margin-left:-10px;
}
.aFont{
font-size: 14px;
}
.mui-icon{
display:inline-block;
font-size:20px;
color: #5ab2e0;
}
span{
display: inline-block;
}
.display_none{
display:none;
}
.mui-btn-custom{
background:#5ab2e0;
margin-top:3px;
height:38px;
border-color: #0081C2 1px;
}
.between-space{
display:inline-block;
margin: 0px 5%;
}
我的位置
我的位置
选定位置
---------------------------------------------------------Code-------------------------------------------------
- /* location.control.gelocation.js detail:
* the script bellow defined amount of function to get data about gelocation
* tips:
* before programe u need to add map display .css file && geolocation Key authorization to the file reference file
* #1
* #2
*/
// 当前点居中 !
mui.plusReady(function(){
/* DOM ELEMENT */
var UI ={
header : document.getElementById("header"),
footer : document.getElementById("footer"),
divMapContainer : document.getElementById("mapContainer"),
divScrollPos : document.getElementById("scrollPos"),
btnPostion : document.getElementById("postion"),
btnSubmit : document.getElementById("submitPos"),
};
/* G variable */
var strErrorParamNotInvalid = 'ParamNotInvalid';
var strErrorDistancePointInvalid = 'DistancePointInvalid';
var posLngLat ={ //当前定位地图 点坐标 [经度,纬度]
Lng : undefined,
Lat : undefined
}
var geolocationObject = { //当前大区[省-城市-区|县]
province :undefined,
city :undefined,
district :undefined
};
var geolocation ; //浏览器定位插件类
var loadMask; //加载遮罩蒙版
var mapResetFlag = 0; //地图重置标志
//var callLocation = 0;
var map = new AMap.Map("mapContainer", {
resizeEnable: true, //缩放显示
zoom: 10 //地图显示的缩放级别
});
//地图中添加地图操作ToolBar插件
map.plugin(['AMap.ToolBar'], function() {
var toolBar = new AMap.ToolBar();
map.addControl(toolBar);
});
var GeolocationInit = function(){
if(!envirVariableCheck("RESET")){ return ;}
map.plugin('AMap.Ge