当前位置: 首页 > news >正文

辽阳做网站公司最新seo新手教程

辽阳做网站公司,最新seo新手教程,做项目的网站,手机上的软件网站建设1.uniapp官方文档说明 2.关键代码片段 // 仅调用初始化,才会触发 on.("markerClusterCreate", (e) > {})this._mapContext.initMarkerCluster({enableDefaultStyle: false, // 是否使用默认样式zoomOnClick: true, // 点击聚合的点,是否…

1.uniapp官方文档说明
在这里插入图片描述
在这里插入图片描述

2.关键代码片段

	// 仅调用初始化,才会触发 on.("markerClusterCreate", (e) => {})this._mapContext.initMarkerCluster({enableDefaultStyle: false, // 是否使用默认样式zoomOnClick: true, // 点击聚合的点,是否改变地图的缩放级别gridSize: 60, // 聚合计算时网格的像素大小,默认60complete(res) {console.log('initMarkerCluster', res)}});

3.全部代码

<template><view class="content"><map id="map" :latitude="latitude" :longitude="longitude":style="{ width: '100%', height: windowHeight + 'px' }" :scale="10" @markertap="markTap"></map></view>
</template><script>export default {data() {return {_mapContext: null,windowHeight: 0,latitude: 23.099994,longitude: 113.324520,}},onLoad() {},onReady() {uni.getSystemInfo({success: (res) => {this.windowHeight = res.windowHeight;},});// 创建map对象this._mapContext = uni.createMapContext("map", this);this.cluster();},methods: {markTap(e) {console.log('ccccccc')console.log(e)console.log('ccccccc')uni.showToast({title: `客户名称${e.markerId}`})},// 点聚合cluster() {// 仅调用初始化,才会触发 on.("markerClusterCreate", (e) => {})this._mapContext.initMarkerCluster({enableDefaultStyle: false, // 是否使用默认样式zoomOnClick: true, // 点击聚合的点,是否改变地图的缩放级别gridSize: 60, // 聚合计算时网格的像素大小,默认60complete(res) {console.log('initMarkerCluster', res)}});this._mapContext.on("markerClusterCreate", (res) => {console.log("markerClusterCreate", res);const clusters = res.clustersconst markers = clusters.map(cluster => {const {center,clusterId,markerIds} = clusterreturn {...center,width: 0,height: 0,clusterId, // 必须label: {content: markerIds.length + '',fontSize: 16,color: '#ffffff',width: 50,height: 50,bgColor: '#00A3FA',borderRadius: 25,textAlign: 'center',anchorX: 0,anchorY: -20,}}})this._mapContext.addMarkers({markers,clear: false,complete(res) {console.log('clusterCreate addMarkers', res)}})});this._mapContext.on('markerClusterClick', (res) => {console.log('markerClusterClick', res)})this.addMarkers();},// 添加标记点addMarkers() {const positions = [{latitude: 23.099994,longitude: 113.324520,id: 12}, {latitude: 23.099994,longitude: 113.322520,id: 13}, {latitude: 23.099994,longitude: 113.326520,id: 14}, {latitude: 23.096994,longitude: 113.329520,id: 15}]const markers = []positions.forEach((p, i) => {markers.push(Object.assign({}, {id: p.id,iconPath: "/static/pile.png",width: 28,height: 29,joinCluster: true, // 指定了该参数才会参与聚合callout: {bgColor: "#5AC2EB",color: "#fff",content: `充电桩${p.id}`,display: "ALWAYS",fontSize: "14",fontWeight: "bold",padding: 8,textAlign: "center"}}, p))})console.log('markers', markers)this._mapContext.addMarkers({markers,clear: false,complete(res) {console.log('addMarkers', res)}})},}}
</script><style>.content {display: flex;flex-direction: column;align-items: center;justify-content: center;}.logo {height: 200rpx;width: 200rpx;margin-top: 200rpx;margin-left: auto;margin-right: auto;margin-bottom: 50rpx;}.text-area {display: flex;justify-content: center;}.title {font-size: 36rpx;color: #8f8f94;}
</style>

3.效果
在这里插入图片描述

在这里插入图片描述

http://www.mmbaike.com/news/39319.html

相关文章:

  • 如何做色情网站seo软件视频教程
  • 精品网站建设费用磐石网络名气青岛做网络推广的公司有哪些
  • 网站的源码十大网站平台
  • 建设网站的相关费用360优化大师官方最新
  • tooopen素材公社上海seo优化培训机构
  • 学校网站建设可行性分析免费网络推广软件
  • 电子商务网站建设开发友情链接如何添加
  • 济宁市网站建设如何制作微信小程序店铺
  • 网站ip改变 备案seo怎么优化步骤
  • 网站建设网银开通百度推广有哪些形式
  • 统计局网站群建设方案360优化大师官方下载最新版
  • 注册个网站多少钱湖南知名网络推广公司
  • 网站建设公司讯息如何学会推广和营销
  • 专门做网站代购的盈利路子北京seo顾问推推蛙
  • wordpress 是免费的吗兰州seo优化入门
  • 企业网站建设哪家好站长工具查询域名
  • 动易6.8网站头seo如何提高网站排名
  • 上海网站建设百度推广公司快手seo
  • 自做头像的网站代写平台
  • 做网站和软件有区别吗百度app官方下载安装到手机
  • 网站改版 更换域名推广营销
  • 哈尔滨网站建设自助建站南宁网站推广哪家好
  • 乐之网站制作逆冬seo
  • 天津建设工程信息网怎么投标百度网站优化工具
  • html网站制作答辩ppt百度seo公司电话
  • 网站制作网站维护怎么做ppt
  • 网站首页浮动广告怎么做手机优化专家
  • wordpress 阿里短信seo岗位培训
  • seo提升排名南京百度关键字优化价格
  • 一亩田的网络营销方式seo点击软件