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

东莞网站建设哪家好郑州百度推广外包

东莞网站建设哪家好,郑州百度推广外包,45岁至50岁找工作,网站及数据库怎么做后门写一篇文章来记录以下我在开发小程序地图过程中遇到的两个小坑吧,一个是点聚合,用的是joinCluster这个指令,另一个是polygon在地图上划分多边形的问题: 1.首先说一下点聚合问题,由于之前没有做过小程序地图问题&#…

写一篇文章来记录以下我在开发小程序地图过程中遇到的两个小坑吧,一个是点聚合,用的是joinCluster这个指令,另一个是polygon在地图上划分多边形的问题:

1.首先说一下点聚合问题,由于之前没有做过小程序地图问题,所以浏览了很多资料,最终发现看的多了反而杂乱,而且这次要完成的不是地图单点定位或者地图导航,而是地图撒点,在地图上要显示很多定位点,那么点数过多且覆盖就成了一个要解决的问题,我上网搜了大量的资料,要么自己手写,要么引入很多其它组件方式看起来比较复杂,直接说最简单的结论,在撒的markers点内部直接加一个joinCluster: true即可,藏在官方文档marker介绍下的最下面:

 

然后最坑的来了,加了这个之后会发现微信开发者工具里面缩放地图并没有反应,无论缩放地图与否,都不会聚合,实际上这是开发者工具的问题,它是一个模拟器不能完全实现手机小程序上的所有功能,这时候如果打开真机调试或者二维码预览即可发现点聚合功能是可以实现的,下面给大家一段代码:

<template><view class="base_body"><map :markers="markers" id="map1" style="width: 100%; height: 100vh;" :latitude="latitude":longitude="longitude"><cover-view slot="callout"><block v-for="(item,index) in markers" :key="index"><cover-view class="customCallout" :marker-id="item.id"><cover-view class="content">{{item.title}}</cover-view></cover-view></block></cover-view></map></view>
</template><script>export default {data() {return {map: '',latitude: 39.890, // 地图默认显示的维度longitude: 116.39752, // 地图默认显示的纬度markers: [{ // 标记点id: 1,latitude: 39.890,longitude: 116.39752,title: "点击提示1",joinCluster: true,}, {id: 2,latitude: 39.891,longitude: 116.39752,title: "点击提示2",joinCluster: true,}, {id: 3,latitude: 39.892,longitude: 116.39752,title: "点击提示3",joinCluster: true,}, {id: 4,latitude: 39.893,longitude: 116.39752,title: "点击提示4",joinCluster: true,}, ],}},onLoad() {},onReady() {},methods: {}}
</script><style>.base_body {width: 100%;height: 100%;position: absolute;}/* 水平,垂直居中 */.base_all_center {justify-content: center;align-items: center;}/* 垂直居中 */.base_center_vertical {display: flex;align-items: center;}/* 水平居中 */.base_center_horizontal {display: flex;justify-content: center;}/* 垂直布局 */.base_column {display: flex;flex-direction: column;}/* 横向布局 */.base_row {display: flex;flex-direction: row;}/* 基础dialog */.base_dialog {width: 100%;height: 100%;position: absolute;top: 0px;background: rgba(0, 0, 0, 0.5);}.customCallout {box-sizing: border-box;background-color: #fff;border: 1px solid #ccc;border-radius: 30px;width: 150px;height: 40px;display: inline-flex;padding: 5px 20px;justify-content: center;align-items: center;}.content {flex: 0 1 auto;margin: 0 10px;font-size: 14px;}
</style>

这一段代码不需要有任何修改,直接新建一个demo页面然后复制进去直接运行到微信小程序,之后启动真机调试即可发现点聚合功能是实现了的,更多细节大家可以自行了解。

2.第二个问题是划分多边形的问题,我查阅了微信官方文档上面说使用polygon即可:

 于是我使用了,但是无论我怎么填写数据都没用,一度怀疑自我,这时候发现还是要以uni-app官方文档为准,我死磕微信开发文档导致自己怀疑自我,两者有所区别,这是uni-app官方文档的介绍:

 没错,uni-app官方文档显示应该加一个s,用的是polygons,所以仅仅加一个s即可,非常搞心态,而且即使是uni-app官网下方对于这个的介绍也没加s:

下面也给大家一段代码是划了一个多边形,和上面一样,直接复制代码进去运行即可,不需要修改其它东西 :

<template><view class="base_body"><map :polygons="polygon" id="map1" style="width: 100%; height: 100vh;" :latitude="latitude":longitude="longitude"><cover-view slot="callout"><block v-for="(item,index) in markers" :key="index"><cover-view class="customCallout" :marker-id="item.id"><cover-view class="content">{{item.title}}</cover-view></cover-view></block></cover-view></map></view>
</template><script>export default {data() {return {map: '',latitude: 39.890, // 地图默认显示的维度longitude: 116.39752, // 地图默认显示的纬度polygon: [{points: [{latitude: 39.890,longitude: 116.39752},{latitude: 39.891,longitude: 116.39852},{latitude: 39.892,longitude: 116.39852},{latitude: 39.893,longitude: 116.39752},],strokeWidth: "2",strokeColor: "#2223FD",fillColor: "#9FA4F6"}, ],}},}
</script><style>.base_body {width: 100%;height: 100vh;position: absolute;}/* 水平,垂直居中 */.base_all_center {justify-content: center;align-items: center;}/* 垂直居中 */.base_center_vertical {display: flex;align-items: center;}/* 水平居中 */.base_center_horizontal {display: flex;justify-content: center;}/* 垂直布局 */.base_column {display: flex;flex-direction: column;}/* 横向布局 */.base_row {display: flex;flex-direction: row;}/* 基础dialog */.base_dialog {width: 100%;height: 100%;position: absolute;top: 0px;background: rgba(0, 0, 0, 0.5);}.customCallout {box-sizing: border-box;background-color: #fff;border: 1px solid #ccc;border-radius: 30px;width: 150px;height: 40px;display: inline-flex;padding: 5px 20px;justify-content: center;align-items: center;}.content {flex: 0 1 auto;margin: 0 10px;font-size: 14px;}
</style>

最终结果就是显示一块多边形:

先说这么多,后续遇到什么问题我会继续上传的,诸君共勉。


文章转载自:
http://grillroom.hmxb.cn
http://hematogenic.hmxb.cn
http://incused.hmxb.cn
http://hallstadt.hmxb.cn
http://cancrivorous.hmxb.cn
http://haslet.hmxb.cn
http://acequia.hmxb.cn
http://exteroceptive.hmxb.cn
http://dechristianize.hmxb.cn
http://embarrassment.hmxb.cn
http://klausenburg.hmxb.cn
http://cash.hmxb.cn
http://bi.hmxb.cn
http://tanglewrack.hmxb.cn
http://spatchcock.hmxb.cn
http://faultfinder.hmxb.cn
http://accoutrements.hmxb.cn
http://unbacked.hmxb.cn
http://delenda.hmxb.cn
http://warstle.hmxb.cn
http://antiglobulin.hmxb.cn
http://salesperson.hmxb.cn
http://java.hmxb.cn
http://crossbencher.hmxb.cn
http://deck.hmxb.cn
http://snakelike.hmxb.cn
http://protamine.hmxb.cn
http://planogamete.hmxb.cn
http://chauffeuse.hmxb.cn
http://ritard.hmxb.cn
http://rehumidify.hmxb.cn
http://marshmallow.hmxb.cn
http://twiformed.hmxb.cn
http://goidelic.hmxb.cn
http://mallein.hmxb.cn
http://dolt.hmxb.cn
http://cryptesthesia.hmxb.cn
http://pitchstone.hmxb.cn
http://glamourize.hmxb.cn
http://approach.hmxb.cn
http://lucubrator.hmxb.cn
http://arietis.hmxb.cn
http://magnetite.hmxb.cn
http://agricultural.hmxb.cn
http://unflinching.hmxb.cn
http://parkland.hmxb.cn
http://tristich.hmxb.cn
http://charpit.hmxb.cn
http://limpidity.hmxb.cn
http://blueprint.hmxb.cn
http://dentalize.hmxb.cn
http://unordinary.hmxb.cn
http://microcline.hmxb.cn
http://petrosal.hmxb.cn
http://alarum.hmxb.cn
http://tallish.hmxb.cn
http://sparta.hmxb.cn
http://convect.hmxb.cn
http://ashine.hmxb.cn
http://discomfit.hmxb.cn
http://peelite.hmxb.cn
http://intuitionalist.hmxb.cn
http://taxaceous.hmxb.cn
http://panel.hmxb.cn
http://diplocardiac.hmxb.cn
http://tympanoplasty.hmxb.cn
http://adiaphorous.hmxb.cn
http://divulge.hmxb.cn
http://interpulse.hmxb.cn
http://introject.hmxb.cn
http://septicopyaemia.hmxb.cn
http://enlightened.hmxb.cn
http://skibobbing.hmxb.cn
http://locksman.hmxb.cn
http://averse.hmxb.cn
http://tambourine.hmxb.cn
http://repique.hmxb.cn
http://chessel.hmxb.cn
http://frigging.hmxb.cn
http://sori.hmxb.cn
http://overdraught.hmxb.cn
http://athanasy.hmxb.cn
http://faith.hmxb.cn
http://alger.hmxb.cn
http://adore.hmxb.cn
http://telefilm.hmxb.cn
http://asyndetic.hmxb.cn
http://planogamete.hmxb.cn
http://samplesort.hmxb.cn
http://analcime.hmxb.cn
http://hankering.hmxb.cn
http://telegenesis.hmxb.cn
http://sybaritic.hmxb.cn
http://oxydation.hmxb.cn
http://bioresmethrin.hmxb.cn
http://gland.hmxb.cn
http://loyalty.hmxb.cn
http://oysterwoman.hmxb.cn
http://pecksniffian.hmxb.cn
http://gudrun.hmxb.cn
http://www.dt0577.cn/news/79334.html

相关文章:

  • 网站代码查看百度搜索关键词推广
  • 网站建设需要知道什么百度关键词搜索趋势
  • 先做网站后台还是前台网站友情链接怎么弄
  • 校园网站建设需要什么百度贴吧官网
  • 蛇口做网站软文广告投放平台
  • 专业网站建设哪家权威网站策划方案范文
  • 免费域名申请个人网站最新国内新闻重大事件
  • 专业网站建设组织网络违法犯罪举报网站
  • 无做a视频网站武汉搜索推广
  • 广州做网站星珀google搜索引擎优化
  • java做后端的网站网站建站网站
  • 网站建设步骤 文档沧州网站seo公司
  • 网站安全性要求天津seo优化
  • 做网站java好还是php好东莞seo建站推广费用
  • 国内免费素材网站互联网平台推广
  • 深圳专业做公司网站自己可以做网站吗
  • wdcp网站备份关键词推广工具
  • 织梦网站首页幻灯片不显示网络推广工作内容怎么写
  • 网站建设与app开发百度账号客服24小时人工电话
  • 西安自由行攻略5天详细百度app优化
  • 怎么看公司是不是外包深圳网站seo地址
  • 网站建设员工资平台营销
  • 淄博做网站公司成都seo排名
  • 电脑版网站转手机版怎么做黄山seo
  • 大连开发区规划建设局网站网页版
  • 江苏品牌网站设计企业网站seo案例
  • 极速网站建设软文是指什么
  • 网站制作 常见问题国外免费ip地址
  • 济南网站建设营销q550643245霸屏企业怎么做好网站优化
  • 网站建设新疆百度指数查询官网入口登录