This commit is contained in:
xuhe@fangjia.com
2018-04-10 13:02:28 +08:00
parent 1abebb5603
commit bb7347c289
5 changed files with 98 additions and 23 deletions
@@ -135,22 +135,35 @@ $.config = {router: false}
<script type='text/javascript' src='../../js/validate.js' charset='utf-8'></script>
<script>
//document.addEventListener('plusready', onPlusReady, false);
var lat = 31.2221;
document.addEventListener('plusready', onPlusReady, false);
var lat = 31.2221;
var lng = 121.359204;
var city = "上海";
var address="广顺小区";
var outTime="20分钟";
var budget=500;
var area="90-110㎡";
//var houseListJson=[]
/*var lat;
var lng;
var city;
var address;
var outTime;
var budget;
var area;*/
var houseListJson=[]
var mapConfig = {}
//扩展API加载完毕,现在可以正常调用扩展API
/*function onPlusReady(){
function onPlusReady(){
var self = plus.webview.currentWebview();
houseStatus = self.houseStatus;
}*/
var mapConfig = {
lat = self.lat;
lng = self.lng;
city = self.city;
address = self.address;
outTime = self.outTime;
budget = self.budget;
area = self.area;
mapConfig = {
isFirstLoad: true,
datas: {
// myIcon: "<div class='positionIcon'></div>",
@@ -194,6 +207,7 @@ var mapConfig = {
this.mapObj = new BMap.Map("map", {minZoom:this.datas.minZoom,maxZoom:this.datas.maxZoom})
}
this.mapObj.enableScrollWheelZoom();
alert(this.datas.center.lat);
this.mapObj.centerAndZoom(this.datas.center, this.datas.zoom);
var that = this;
@@ -476,8 +490,17 @@ var mapConfig = {
   localSearch.search(region);
}
}
$(document).ready(function(){
mapInit();
//setTimeout("mapInit()","1000");
}
function mapInit(){
/*lat = 31.2221;
lng = 121.359204;
city = "上海";
address="广顺小区";
outTime="20分钟";
budget=500;
area="90-110㎡";*/
axios.get("/rest/intelligentHouse/mapDetail", {
params: {
city: city,
@@ -490,7 +513,6 @@ $(document).ready(function(){
}
})
.then(function (response) {
console.log(response)
houseListJson = response.data.data.houseListJson;
$("#city").val(response.data.data.city);
$("#address").val(response.data.data.address);
@@ -501,6 +523,7 @@ $(document).ready(function(){
$("#minAvgPrice").val(response.data.data.minAvgPrice);
$("#maxAvgPrice").val(response.data.data.maxAvgPrice);
$("#houseNum").text(response.data.data.houseNum);
//mapInit();
mapConfig.init()
$('#map').on('click', ".positionBox .close", function (e) {
mapConfig.hidePopWin()
@@ -509,7 +532,25 @@ $(document).ready(function(){
.catch(function (error) {
console.log(error);
});
})
}
//mapInit()
$(document).ready(function(){
});
/*var t1;
function mapInit(){
t1 = window.setTimeout(loadMap,1000);
}
function loadMap(){
if(lng && lat){
mapConfig.init();
window.clearTimeout(t1);
}
}*/
function getAroundList(){
var city = $("#city").val();
var address = $("#address").val();