zoukankan      html  css  js  c++  java
  • 个人相关API

            calculateDrivingDirection(newCoordinates,oldCoordinates){
                let o = {
                        direction: '',
                        deviation:null,
                        isTop:  false,
                        isRight:  false,
                        newLng:  newCoordinates[0],
                        newLat:  newCoordinates[1],
                        oldLng:  oldCoordinates[0],
                        oldLat:  oldCoordinates[1],
                }
                o.deviation = Math.abs((o.newLng - o.oldLng)) - Math.abs((o.newLat - o.oldLat))
                o.newLng - o.oldLng > 0 ? o.isRight = true : o.isRight = false
                o.newLat - o.oldLat > 0 ? o.isTop = true : o.isTop = false
                if(o.deviation > 0){ // 大于零 水平方向移动
                    o.isRight ? o.direction = 'right' : o.direction = 'left'
                }else{ //  小于零 垂直方向移动
                    o.isTop ? o.direction = 'top' : o.direction = 'down'
                }
    
                return o.direction
            },
    

      

        .car-loc-marker.right{
            transform: rotate(0deg)
        }
        .car-loc-marker.left{
            transform: rotate(180deg)
        }
        .car-loc-marker.top{
            transform: rotate(-90deg)
        }
        .car-loc-marker.down{
            transform: rotate(90deg)
        }
    API 
    marker.moveTo()
     
  • 相关阅读:
    服务器内部模拟Http请求
    面试题分类
    Linux常用命令
    css补充之hover与overflow
    css之position
    css边框及float、display样式
    css存在形式及优先级
    css选择器
    body标签之fieldest与label标签
    body内标签之table标签
  • 原文地址:https://www.cnblogs.com/tongbiao/p/11687307.html
Copyright © 2011-2022 走看看