zoukankan      html  css  js  c++  java
  • 每日总结

    今天学习了将爬取的疫情内容显示到地图上的内容

     // 初始化
        reset () {
          const {getMapScript, initMap} = this
          getMapScript().then(initMap)
        },
        // 获取baidumap
        getMapScript () {
          if (!global.BMap) {
            const ak = this.ak || this._BMap().ak
            global.BMap = {}
            global.BMap._preloader = new Promise((resolve, reject) => {
              global._initBaiduMap = function () {
                resolve(global.BMap)
                global.document.body.removeChild($script)
                global.BMap._preloader = null
                global._initBaiduMap = null
              }
              const $script = document.createElement('script')
              global.document.body.appendChild($script)
              $script.src = `https://api.map.baidu.com/api?v=2.0&ak=${ak}&callback=_initBaiduMap`
            })
            return global.BMap._preloader
          } else if (!global.BMap._preloader) {
            return Promise.resolve(global.BMap)
          } else {
            return global.BMap._preloader
          }
        },
        // 获取BMap, 初始化地图
        initMap (BMap) {
          this.BMap = BMap
          this.init(BMap)
        },
        init (BMap) {
          let $el = this.$refs.basicMap
          const map = new BMap.Map($el)
          this.map = map
          this.setMapOptions()
          map.centerAndZoom(this.initCenter, this.initZoom)
          this.$emit('ready', {BMap, map})
        },
        // 设置地图配置
        setMapOptions () {
        }
    

      

  • 相关阅读:
    Centos7yum安装LNMP
    CentOS7安装和配置rsync+inotify
    SSH
    nginx https
    nginx rewrite
    nginx代理缓存
    nginx动静分离
    Centos7使用squid实现正向代理
    利用tengine的nginx_upstream_check_module来检测后端服务状态
    nginx基于tcp负载均衡
  • 原文地址:https://www.cnblogs.com/wrljzb/p/14910713.html
Copyright © 2011-2022 走看看