1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <!--********************************************************************
- * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- *********************************************************************-->
- <html>
- <head>
- <meta charset='utf-8'/>
- <title data-i18n="resources.title_echartsLinesMillions_bjRoads"></title>
- <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no'/>
- <script type="text/javascript" include="jquery" src="../js/include-web.js"></script>
- <script type="text/javascript" include="echarts" src="../../dist/leaflet/include-leaflet.js"></script>
- <style>
- body {
- margin: 0;
- padding: 0;
- }
- #map {
- position: absolute;
- top: 0;
- bottom: 0;
- width: 100%;
- }
- </style>
- </head>
- <body>
- <div id='map'></div>
- <script type="text/javascript">
- var host = window.isLocal ? window.server : "https://iserver.supermap.io";
- var tileURL = host + "/iserver/services/map-china400/rest/maps/ChinaDark";
- map = L.map('map', {
- center: [39.98, 116.36],
- maxZoom: 18,
- zoom: 10
- });
- L.supermap.tiledMapLayer(tileURL).addTo(map);
- option = {
- progressive: 20000,
- title: {
- top: '10px',
- text: resources.text_echartsLinesMillions_bjRoads,
- subtext: resources.text_echartsLinesMillions_bjRoads_subtext,
- left: 'center',
- textStyle: {
- color: '#fff'
- },
- subtextStyle: {
- color: '#fff'
- }
- },
- series: [{
- type: 'lines',
- blendMode: 'lighter',
- coordinateSystem: 'leaflet',
- dimensions: ['value'],
- data: new Float64Array(),
- polyline: true,
- large: true,
- lineStyle: {
- color: 'orange',
- width: 1,
- opacity: 0.3
- }
- }]
- };
- var echartsLayer = L.supermap.echartsLayer(option).addTo(map);
- var CHUNK_COUNT = 19;
- function fetchData(idx) {
- if (idx > CHUNK_COUNT) {
- return;
- }
- var dataURL = "https://iclient.supermap.io/web/data/bigdata_beijingroads/data_" + idx + ".bin";
- var xhr = new XMLHttpRequest();
- xhr.open('GET', dataURL, true);
- xhr.responseType = 'arraybuffer';
- xhr.onload = function (e) {
- var rawData = new Float32Array(this.response);
- echartsLayer._ec.appendData({
- seriesIndex: 0,
- data: rawData
- });
- fetchData(idx + 1);
- };
- xhr.send();
- }
- fetchData(0);
- </script>
- </body>
- </html>
|