zoukankan      html  css  js  c++  java
  • 利用半径找到经纬度

      //获取经纬度
      getLocation() {
        let self = this;
        let list = [];
        let radius = this.data.currentScope // 获取当前半径
    // envelopeList = ['445','666','1002']
        self.data.envelopeList.forEach((item, index) => {
          let rotate = Math.random()*360; //获取随机弧度,需要把弧度转化为度,三角函数获取经纬度
          var x = (Math.round(Math.cos(rotate * Math.PI / 180) * 1000000) / 1000000 * item) * 0.00000899;
          var y = (Math.round(Math.sin(rotate * Math.PI / 180) * 1000000) / 1000000 * item) * 0.00001141;
          let data = {
            'latitude': self.data.latitude + x,
            'longitude': self.data.longitude + y,
            'width': 50,
            'height': 60,
          }
          if (item <= radius) {
             data['id'] = index + 100;
          }else{
            data.id = index
          }
          if (item <= 1000) {
            data.iconPath = self.data.normalIco;
          } else if (item <= 1200) {
            data.iconPath = self.data.mediumIcon
          } else {
            data.iconPath = self.data.advancedIco
            data.width = 75;
            data.height = 60
          }
          list.push(data)
        })
        self.setData({
          markers:list
        })
    
    
    
      },
    

      

  • 相关阅读:
    GAN 的推导、证明与实现。
    WGAN学习笔记
    常用损失函数积累
    交叉熵在loss函数中使用的理解
    贝叶斯决策
    极大似然估计
    gated pixelCNN。
    三叉搜索树 转载
    Rabin-Karp 字符串匹配算法
    面试题整理 转载
  • 原文地址:https://www.cnblogs.com/linsx/p/9760780.html
Copyright © 2011-2022 走看看