|
@@ -69,7 +69,7 @@ Page({
|
|
|
markers: [INIT_MARKER],
|
|
|
latitude: '',
|
|
|
longitude: '',
|
|
|
- custGap: 100000,
|
|
|
+ custGap: 1000,
|
|
|
type: [
|
|
|
[{ "id": 1, "name": "政务公开", "image": "fgk.png","dictType":"" }, { "id": 2, "name": "政务服务", "image": "fzwfw.png" ,"dictType":""}, { "id": 3, "name": "党群服务", "image": "fdqfwzx.png" ,"dictType":""},{ "id": 4, "name": "教育资源", "image": "fjy.png","dictType":"" }],
|
|
|
[{ "id": 1, "name": "医疗卫生", "image": "fyl.png" ,"dictType":""}, { "id": 2, "name": "户籍管理", "image": "fhjgl.png" ,"dictType":""}, { "id": 3, "name": "交通服务", "image": "fjtfw.png" ,"dictType":""},{ "id": 4, "name": "社会保障", "image": "fshbz.png","dictType":"" }],
|
|
@@ -129,7 +129,7 @@ Page({
|
|
|
this.setData({
|
|
|
height: wx.getSystemInfoSync().windowHeight
|
|
|
})
|
|
|
- console.log(options);
|
|
|
+ // console.log(options);
|
|
|
if (options.se) {
|
|
|
this.setData({
|
|
|
loadValue: options.se,
|
|
@@ -144,13 +144,19 @@ Page({
|
|
|
// searchVal
|
|
|
},
|
|
|
onReady:function () {
|
|
|
-
|
|
|
+ // debugger
|
|
|
const that = this
|
|
|
this.loadItem();
|
|
|
getMapDataAll().then((res) => {
|
|
|
- let arr = []
|
|
|
- Array.prototype.push.apply(arr, res.data.xzfwzxs);
|
|
|
- Array.prototype.push.apply(arr, res.data.ggfwzxs);
|
|
|
+ let arr = []
|
|
|
+ console.log(res.data);
|
|
|
+ for (const key in res.data) {
|
|
|
+ // console.log(res.data[key]);
|
|
|
+ Array.prototype.push.apply(arr,res.data[key])
|
|
|
+ }
|
|
|
+
|
|
|
+ // Array.prototype.push.apply(arr, res.data.xzfwzxs);
|
|
|
+ // Array.prototype.push.apply(arr, res.data.ggfwzxs);
|
|
|
for (let j = 0; j < arr.length; j++) {
|
|
|
if(arr[j].tel && !(arr[j].tel instanceof Array)){
|
|
|
arr[j].tel = arr[j].tel.split(";")
|
|
@@ -196,7 +202,7 @@ Page({
|
|
|
width: '30px',
|
|
|
height: '30px',
|
|
|
rotate: 0,
|
|
|
- alpha: 1
|
|
|
+ alpha: 1
|
|
|
}]
|
|
|
});
|
|
|
}
|
|
@@ -1072,7 +1078,16 @@ function initMapDataAll(that, lat, lng) {
|
|
|
width: '30px',
|
|
|
height: '30px',
|
|
|
rotate: 0,
|
|
|
- alpha: 1
|
|
|
+ alpha: 1,
|
|
|
+ label: {
|
|
|
+ anchorX: 10,
|
|
|
+ anchorY: -22,
|
|
|
+ bgColor: '#fff',
|
|
|
+ borderRadius: 5,
|
|
|
+ padding: 5,
|
|
|
+ content: "我的位置",
|
|
|
+ color: '#333'
|
|
|
+ }
|
|
|
})
|
|
|
console.log(addrArr)
|
|
|
that.setData({
|
|
@@ -1085,7 +1100,7 @@ function initMapDataAll(that, lat, lng) {
|
|
|
}
|
|
|
const address = arr[index]
|
|
|
index++
|
|
|
- const jl = getDistances(lat, lng, address.latitude, address.longitude)
|
|
|
+ const jl = getDistances(lat, lng, address.latitude, address.longitude)
|
|
|
console.log(jl)
|
|
|
if (jl.m <= that.data.custGap) {
|
|
|
marksView.push(address)
|
|
@@ -1097,7 +1112,16 @@ function initMapDataAll(that, lat, lng) {
|
|
|
width: '34px',
|
|
|
height: '34px',
|
|
|
rotate: 0,
|
|
|
- alpha: 1
|
|
|
+ alpha: 1,
|
|
|
+ label: {
|
|
|
+ anchorX: 10,
|
|
|
+ anchorY: -22,
|
|
|
+ bgColor: '#fff',
|
|
|
+ borderRadius: 5,
|
|
|
+ padding: 5,
|
|
|
+ content: address.dep,
|
|
|
+ color: '#333'
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
// BMap.geocoder({
|