diff --git a/miniprogram/pages/defineMap/defineMap.js b/miniprogram/pages/defineMap/defineMap.js index 33bcec3..500a1d7 100644 --- a/miniprogram/pages/defineMap/defineMap.js +++ b/miniprogram/pages/defineMap/defineMap.js @@ -42,7 +42,7 @@ ], longitude: "116.627340", latitude: "39.874390", - scale: 12, + scale: 17, minScale: 2, maxScale: 22, markers: [], @@ -578,20 +578,23 @@ // latitude: '39.908599446615', // longitude: '116.391914605035', }) - console.log('获取到当前定位', parseFloat(res.latitude).toFixed(6), parseFloat(res.longitude).toFixed(6)); + console.log('获取到当前定位', parseFloat(res.latitude), parseFloat(res.longitude)); // 将地图中心移动到当前定位点 const mapCtx = wx.createMapContext('map'); mapCtx.moveToLocation(); wx.hideLoading() if(wellList.length) { // const tempList = that.filterNearbyPoints(wellList, '39.908599446615', '116.391914605035') - const tempList = that.filterNearbyPoints(wellList, parseFloat(res.latitude).toFixed(6), parseFloat(res.longitude).toFixed(6)) + const tempList = that.filterNearbyPoints(wellList, parseFloat(res.latitude), parseFloat(res.longitude)) console.log('获取当前人的定位周围100米的数据',tempList.length, tempList); if(tempList.length) { that.initManholeData(tempList) mapCtx.moveToLocation({ latitude: tempList[0].latGaode, - longitude: tempList[0].lngGaode + longitude: tempList[0].lngGaode, + }); + that.setData({ + scale: 17 }); } else { wx.showToast({