返回

专注连锁门店会员营销管理系统

线上+线下+进销存+收银+会员
HiShop > Hi小程序 > 小程序开发 > 开发实例 >

微信小程序地图划线

2018-05-30 作者:秩名

微信小程序地图划线,是小程序很基本的功能,那么小程序地图划线要怎么实现呢。

微信小程序地图划线
var point = []
var that2



function drawline() {
  
  
  that2.setData({
    polyline: [{
      points: point,
      color: "#99FF00",
      width: 4,
      dottedLine: false
    }],
   

  })
  

}
//获取经纬度
function getlocation() {
  var latitude1, longitude1
  wx.getLocation({
    type: 'gcj02',
    success: function (res) {

      latitude1 = res.latitude
      longitude1 = res.longitude
      point.push({latitude:latitude1, longitude:longitude1}) 
      console.log(point)   
    }
  })
  
}


Page({
  data: {
    polyline: []


  },

 

  

  onReady: function () {
    that2 = this
    wx.getLocation({
      type: 'gcj02',
      success: function (res) {
         that2.setData({
          long: res.longitude,
          lat: res.latitude

        })
       
      }
    })

  }, 


  start:function(){
    
    
    this.timer=setInterval(repeat, 10000);
    
  
    function repeat() {
      console.log("re")
      getlocation()
      drawline()
    }

  },

  end: function () {
    console.log("clear")
    clearInterval(this.timer) 
   
  }

 
})


线上+线下+进销存+收银+会员门店零售管理好帮手

  • 极速收银管理

    门店能实现快速收银,提升门店经营效率。

  • 进销存管理

    系统自带进销存管理,更好管理库存销售。

  • 软硬件一体化

    配备收银硬件一站式整体服务。

收 银 会员管理 库存管理 商品管理 交接班 数据报表 营销促单 售后处理 多种收款

获取报价

推荐文章

门店系统 获取报价 立即咨询 免费试用