乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      openlayers5-webpack 入門開發(fā)系列結(jié)合 echarts4 實(shí)現(xiàn)散點(diǎn)圖(附源碼下載)

       小樣樣樣樣樣樣 2021-12-05

      前言

      openlayers5-webpack 入門開發(fā)系列環(huán)境知識(shí)點(diǎn)了解:

      內(nèi)容概覽

      openlayers5 結(jié)合 echarts4 實(shí)現(xiàn)散點(diǎn)圖
      源代碼 demo 下載

      效果圖如下:

      • 地圖加載代碼如下:
      const map = new Map({
      target: 'map',
      layers: [
      new TileLayer({
      source: new XYZ({
      url: 'http://cache1./arcgis/rest/services/ChinaOnline' +
      'StreetPurplishBlue/MapServer/tile/{z}/{y}/{x}'
      })
      })
      ],
      view: new View({
      center: [113.53450137499999, 34.44104525],
      projection: 'EPSG:4326',
      zoom: 6
      })
      });
      • echarts數(shù)據(jù)源設(shè)置:
      function getJSON (url, callback) {
      const xhr = new XMLHttpRequest();
      xhr.responseType = 'json';
      xhr.open('get', url, true);
      xhr.onload = function () {
      if (xhr.status >= 200 && xhr.status < 300) {
      callback(xhr.response);
      } else {
      throw new Error(xhr.statusText);
      }
      };
      xhr.send();
      }
       
      getJSON('data.json', function (res) {
      if (res) {
      var data = res.locations;
      var geoCoordMap = res.coordinates;
      var convertData = function (data) {
      var res = [];
      for (var i = 0; i < data.length; i++) {
      var geoCoord = geoCoordMap[data[i].name];
      if (geoCoord) {
      res.push({
      name: data[i].name,
      value: geoCoord.concat(data[i].value)
      });
      }
      }
      return res;
      };
      var option = {
      title: {
      text: '全國(guó)主要城市空氣質(zhì)量',
      subtext: '',
      sublink: '',
      left: 'center',
      textStyle: {
      color: '#fff'
      }
      },
      tooltip: {
      trigger: 'item'
      },
      openlayers: {},
      legend: {
      orient: 'vertical',
      y: 'top',
      x: 'right',
      data: ['pm2.5'],
      textStyle: {
      color: '#fff'
      }
      },
      series: [
      {
      name: 'pm2.5',
      type: 'scatter',
      data: convertData(data),
      symbolSize: function (val) {
      return val[2] / 10;
      },
      label: {
      normal: {
      formatter: '',
      position: 'right',
      show: false
      },
      emphasis: {
      show: true
      }
      },
      itemStyle: {
      normal: {
      color: '#ddb926'
      }
      }
      },
      {
      name: 'Top 5',
      type: 'effectScatter',
      data: convertData(data.sort(function (a, b) {
      return b.value - a.value;
      }).slice(0, 6)),
      symbolSize: function (val) {
      return val[2] / 10;
      },
      showEffectOn: 'render',
      rippleEffect: {
      brushType: 'stroke'
      },
      hoverAnimation: true,
      label: {
      normal: {
      formatter: '',
      position: 'right',
      show: true
      }
      },
      itemStyle: {
      normal: {
      color: '#f4e925',
      shadowBlur: 10,
      shadowColor: '#333'
      }
      },
      zlevel: 1
      }]
      };
      }
      });
      • hideOnMoving=false 設(shè)置地圖移動(dòng)過程中不隱藏 echarts 效果,hideOnZooming=false 設(shè)置地圖縮放過程中不隱藏 echarts 效果,stopEvent =false 設(shè)置不阻止echarts 事件

      更多詳情見下面鏈接文章

      GIS之家小專欄此文章:openlayers5-webpack 入門開發(fā)系列結(jié)合 echarts4 實(shí)現(xiàn)散點(diǎn)圖(附源碼下載)

      文章提供源碼,對(duì)本專欄感興趣的話,可以關(guān)注一波

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多