JS代码:
function getCurrentLocation(){
var invocationData={
adapter:'GeoAdapter',
procedure:'getGeoLocation',
paramenters:[]
};
WL.Client.invokeProcedure(invocationData, {
onSuccess:function(result){
// WL.Logger.debug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+result);
var geoX = result.invocationResult.content.point.x;
var geoY = result.invocationResult.content.point.y;
WL.Logger.debug("X="+geoX+"Y="+geoY);
var point = new BMap.Point(geoX,geoY);
map.centerAndZoom(point,10);
},
onFailure: function () {
// WL.Logger.debug("QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ"+result);
console.log('To locate failure');
}
})
}
JSP页面代码:
手机地图定位
window.$ = window.jQuery = WLJQ;
我的定位