条用百度地图api==》经纬度

(“#district”).change(function(){  
        //省市区  
    var provinceVal =
(“#district”).change(function(){          //省市区      var provinceVal =
(“#province”).val();
var cityVal = (“#city”).val();  
    var districtVal =
(“#city”).val();      var districtVal =
(“#district”).val();

// 百度地图API功能
var map = new BMap.Map();
var localSearch = new BMap.LocalSearch(map);

searchByStationName();

function searchByStationName() {
    //地址
    var address = provinceVal+cityVal+districtVal;
    localSearch.setSearchCompleteCallback(function (searchResult) {
        var poi = searchResult.getPoi(0);
        $("#positionY").val(poi.point.lng);
        $("#positionX").val(poi.point.lat);
    });
    localSearch.search(address);
}

});

你可能感兴趣的:(条用百度地图api==》经纬度)