微信小程序地图组件

女爷i 2021-07-25 01:34 775阅读 0赞

index.wxml

  1. <map id="map" markers="{
  2. {markers}}" longitude="{
  3. {longitude}}" latitude="{
  4. {latitude}}" scale="25" circles="{
  5. {circles}}" show-location="{
  6. {true}}" bindmarkertap="marker"></map>

index.js

  1. Page({
  2. data: {
  3. latitude:30.,
  4. longitude:114.,
  5. circles:[{
  6. latitude: 30.,
  7. longitude: 114.,
  8. fillColor:"#8DE25055",
  9. radius:30
  10. }],
  11. markers: [{
  12. iconPath: "/images/icon/map.png",
  13. latitude: 30.,
  14. longitude: 114.,
  15. width: 30,
  16. height: 30,
  17. title:"",
  18. id:0,
  19. label:{
  20. content:"",
  21. color:"#EE5E7B",
  22. borderWidth:1,
  23. borderColor:"#EE5E78",
  24. borderRadius:5,
  25. padding:5,
  26. },
  27. callout:{
  28. content:"",
  29. color:"#EE5E7B",
  30. borderWidth:1,
  31. borderColor:"#EE5E78",
  32. borderRadius:5,
  33. padding:5,
  34. }
  35. }],
  36. },
  37. marker(){
  38. }
  39. })

#

若本号内容有做得不到位的地方(比如:涉及版权或其他问题),请及时联系我们进行整改即可,会在第一时间进行处理。

#

请点赞!因为你们的赞同/鼓励是我写作的最大动力!

欢迎关注达叔小生的简书!

这是一个有质量,有态度的博客

博客

发表评论

表情:
评论列表 (有 0 条评论,775人围观)

还没有评论,来说两句吧...

相关阅读

    相关 程序地图

    地图组件: 完成两大功能:A .显示地理位置;B .标记建筑物。 1、完成最简单的地图显示: 为通过CSS设置一个宽度和高度。 2、如何显示指定位置的地图:

    相关 程序 - 组件

    > 微信小程序为开发者提供了一系列基础组件,使开发者可以进行快速开发。同时还支持自定义组件,提升代码复用性,有助于代码维护。 一、基础组件 > 基础组件主要分为:视图容