以房找人

This commit is contained in:
liuye
2021-12-20 09:35:52 +08:00
parent 020064df11
commit 11fa889027
6 changed files with 148 additions and 69 deletions

View File

@@ -50,7 +50,46 @@ export default {
},
methods: {
initMap() {
initMap() { this.$nextTick(() =>{
let {lib: TMap, map} = this
var markerCluster = new TMap.MarkerCluster({
id: 'cluster',
map: map,
enableDefaultStyle: true, // 启用默认样式
minimumClusterSize: 1, // 形成聚合簇的最小个数
geometries: [{ // 点数组
position: new TMap.LatLng(39.953416, 116.480945)
},
{
position: new TMap.LatLng(39.984104, 116.407503)
},
{
position: new TMap.LatLng(39.908802, 116.497502)
},
{
position: new TMap.LatLng(40.040417, 116.373514)
},
{
position: new TMap.LatLng(39.953416, 116.380945)
},
{
position: new TMap.LatLng(39.984104, 116.307503)
},
{
position: new TMap.LatLng(39.908802, 116.397502)
},
{
position: new TMap.LatLng(40.040417, 116.273514)
},
],
zoomOnClick: true, // 点击簇时放大至簇内点分离
gridSize: 60, // 聚合算法的可聚合距离
averageCenter: false, // 每个聚和簇的中心是否应该是聚类中所有标记的平均值
maxZoom: 10 // 采用聚合策略的最大缩放级别
});
})
},
initMap2() {
//初始化地图
this.$nextTick(() =>{
@@ -240,7 +279,7 @@ uni-page-body{
position: fixed;
bottom: 136px;
right: 24px;
z-index: 99;
z-index: 99999;
padding: 16px 16px 0;
box-sizing: border-box;
font-size: 24px;