hbuilder里如何调用getLocationDescribe()获位置的描述,位置语义化结果
map.showUserLocation(true);
map.getUserLocation(function (state, pos) {
if (0 == state) {
map.setCenter(pos);
//.getLocationDescribe();
plus.maps.Map.reverseGeocode(pos, {}, function (event) {
laddress = event.address; // 转换后的地理位置
var point = event.coord; // 转换后的坐标信息
var coordType = event.coordType; // 转换后的坐标系类型
ar myPoint = new BMap.Point(point.longitude, point.latitude)
if (BMapLib.GeoUtils.isPointInPolygon(myPoint, polygon1)) {
console.log("ok:=" + JSON.stringify(myPoint));
} else {
console.log("ng:=" + JSON.stringify(myPoint));
}
}, function (e) {
alert("Error:" + JSON.stringify(e));
});
}
});
0 个回复