高德点聚合

            //非聚合点样式
            // var _renderMarker = function (context: any) {
            //   context.marker.setIcon(equipIcon);
            //   context.marker.on('click', (e: any) => {
            //     console.log(context, 'context');
            //     // context.marker.setIcon(equipIcon);
            //     clusterRef.value = context.data[0];
            //     context.marker.content = `<div class="speech-bubble">
            //       <div class="speech-bubbles">
            //         <div class="ball"></div>
            //         <div class="balls"></div>
            //         <div class="up-arrow"></div>
            //         <div class="up-arrow-border"></div>
            //         <div class="content">
            //           <div class="info">
            //             <div class="title">
            //               ${context.data[0].title}
            //               <img onclick="closeInfoWindow()" src="${iconerror}" alt="" />
            //             </div>
            //             <div class="bod">
            //               <div class="location">地址:${context.data[0].location}</div>
            //             <div class="leavefor">
            //               <div class="clickrate">
            //                 点击前往:
            //               <img src="${urlImgs}" alt="" onclick="showActionSheet()" />
            //               </div>
            //               <div class="button"><button onclick="closeInfoWindows()">查看场景</button></div>
            //             </div>
            //             </div>
            //           </div>
            //         </div>
            //       </div>
            //     </div>`;

            //     infoWindow.setContent(e.target.content);
            //     infoWindow.open(map, e.target.getPosition());
            //   })
            //   nextTick(() => {
            //     (window as any).closeInfoWindow = () => {
            //       infoWindow.close()
            //     }
            //     (window as any).showActionSheet = () => {
            //       alert(onDeviceReady.value)
            //       if (onDeviceReady.value) {
            //         let url = "https://uri.amap.com/marker?position=" + clusterRef.value.position[0] + "," +
            //           clusterRef.value.position[1] + "&name=" + clusterRef.value.title;
            //         cordova.InAppBrowser.open(url, "_blank", "location=no,zoom=no");

            //       } else {
            //         window.location.href =
            //           "https://uri.amap.com/marker?position=" + clusterRef.value.position[0] + "," +
            //           clusterRef.value.position[1] + "&name=" + clusterRef.value.title;
            //       }

            //     }
            //     (window as any).closeInfoWindows = () => {
            //       showCurtain.value = !showCurtain.value;
            //     }
            //   })
            // };
            // //聚合点样式
            // var _renderClusterMarker = function (context: any) {
            //   // var div = document.createElement("div");
            //   // var fontColor = "hsla(120,50%,0%,1)";
            //   // div.style.width = "37px";
            //   // div.style.height = "46px";
            //   // div.innerHTML = context.count;
            //   // div.style.lineHeight = 40 + "px";
            //   // div.style.color = fontColor;
            //   // div.style.fontSize = "14px";
            //   // div.style.textAlign = "center";
            //   // //自定义显示maker  的图标
            //   // div.style.backgroundImage = "url(../assets/errorRow.svg)"
            //   // context.marker.setOffset(new AMap.Pixel(-40 / 2, -40 / 2));
            //   context.marker.content('<div style="background-color:#ff0000">1</div>');
            //   context.marker.on('click', function (e: any) {
            //     console.log(e, 'e');

            //     infoWindow.setContent(e.target.content);
            //     infoWindow.open(map, e.target.getPosition());
            //   });
            // };
            //将图层添加至地图实例            
            // new AMap.MarkerCluster(map, markerData, {
            //   gridSize: 50, // 聚合网格大小
            //   maxZoom: 12,// 最大聚合层级,
            //   renderMarker: _renderMarker, //上述步骤的自定义非聚合点样式
            // });

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

跟Bug双向奔赴

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值