123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <!--********************************************************************
- * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
- *********************************************************************-->
- <html>
- <head>
- <meta charset='utf-8'/>
- <title data-i18n="resources.title_echartsLinesMillions_roads"></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,ol3-echarts"
- src="../../dist/ol/include-ol.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";
- var map = new ol.Map({
- target: 'map',
- controls: ol.control.defaults({attributionOptions: {collapsed: false}})
- .extend([new ol.supermap.control.Logo()]),
- view: new ol.View({
- center: [106, 37.94],
- zoom: 5,
- projection: 'EPSG:4326',
- multiWorld: true
- }),
- layers: [new ol.layer.Tile({
- source: new ol.source.OSM({}),
- source: new ol.source.TileSuperMapRest({
- url: tileURL,
- prjCoordSys: {"epsgCode": 4326}
- }),
- projection: 'EPSG:4326'
- })]
- });
- var echartslayer = new ol3Echarts(null, {
- hideOnMoving: true,
- hideOnZooming: true
- });
- echartslayer.appendTo(map);
- var option = {
- progressive: 20000,
- title: {
- top: '10px',
- text: resources.text_echartsLinesMillions_roads,
- subtext: resources.text_echartsLinesMillions_roads_subtext,
- left: 'center',
- textStyle: {
- color: '#fff'
- },
- subtextStyle: {
- color: '#fff'
- }
- },
- series: [{
- type: 'lines',
- blendMode: 'lighter',
- dimensions: ['value'],
- data: new Float64Array(),
- polyline: true,
- large: true,
- lineStyle: {
- color: 'orange',
- width: 1,
- opacity: 0.3
- }
- }]
- };
- var CHUNK_COUNT = 27;
- function fetchData(idx) {
- if (idx > CHUNK_COUNT) {
- return;
- }
- var dataURL = "https://iclient.supermap.io/web/data/bigdata_roads_50w/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.appendData({
- seriesIndex: 0,
- data: rawData
- });
- fetchData(idx + 1);
- };
- xhr.send();
- }
- echartslayer.setChartOptions(option);
- fetchData(0);
- </script>
- </body>
- </html>
|