Skip to content

Commit 58d3c5f

Browse files
committed
Release 1.0.0-beta.2
1 parent e19b0b7 commit 58d3c5f

9 files changed

+528
-343
lines changed

dist/echarts-gl.js

+335-275
Large diffs are not rendered by default.

dist/echarts-gl.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "echarts-gl",
33
"description": "Extension pack of ECharts providing 3D plots and globe visualization",
4-
"version": "1.0.0-beta.1",
4+
"version": "1.0.0-beta.2",
55
"maintainers": [
66
{
77
"name": "Yi Shen"
88
}
99
],
1010
"dependencies": {
11-
"qtek": "0.3.9",
11+
"qtek": "0.4.0",
1212
"zrender": "3.5.2"
1313
},
1414
"repository": "https://github.com/ecomfe/echarts-gl",

src/coord/mapbox/Mapbox.js

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ function Mapbox() {
2222
this.height = 0;
2323

2424
this.altitudeScale = 1;
25+
26+
// TODO Change boxHeight won't have animation.
2527
this.boxHeight = 'auto';
2628

2729
// Set by mapbox creator

src/coord/mapboxCreator.js

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ var mapboxCreator = {
8585
mapboxCoordSys.update = updateMapbox;
8686
});
8787

88-
var altitudeDataExtent = [];
8988
ecModel.eachSeries(function (seriesModel) {
9089
if (seriesModel.get('coordinateSystem') === 'mapbox') {
9190
var mapboxModel = seriesModel.getReferringComponents('mapbox')[0];

src/echarts-gl.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434

3535
// PENDING Use a single canvas as layer or use image element?
3636
var echartsGl = {
37-
version: '1.0.0-beta.1',
37+
version: '1.0.0-beta.2',
3838
dependencies: {
3939
echarts: '3.6.2',
40-
qtek: '0.3.9'
40+
qtek: '0.4.0'
4141
}
4242
};
4343
var echarts = require('echarts/lib/echarts');

src/util/graphicGL.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -524,11 +524,11 @@ graphicGL.setMaterialFromModel = function (shading, material, model, api) {
524524
detailUvRepeat: uvRepeat,
525525
detailUvOffset: uvOffset
526526
});
527-
var normalTexture = material.get('normalMap');
528-
if (normalTexture) {
527+
// var normalTexture = material.get('normalMap');
528+
// if (normalTexture) {
529529
// PENDING
530530
// normalTexture.format = Texture.SRGB;
531-
}
531+
// }
532532
}
533533
else if (shading === 'lambert') {
534534
material.setTextureImage('detailMap', detailTexture, api, textureOpt);

test/mapbox-buildings-mapzen.html

+36-21
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,37 @@
2525
chart.setOption({
2626
mapbox: {
2727
// 北京
28-
// center: [116.39157, 39.90673],
28+
center: [116.39157, 39.90673],
2929
// 纽约
3030
// center: [-74.02158343200102, 40.6143657735403],
3131
// 上海
32-
center: [121.4978, 31.2398],
32+
// center: [121.4978, 31.2398],
3333
// 伦敦
3434
// center: [-0.118092, 51.509865],
3535
zoom: 15,
36-
pitch: 50,
37-
bearing: -10,
38-
style: 'mapbox://styles/mapbox/dark-v9',
36+
pitch: 10,
37+
// bearing: -10,
38+
style: 'mapbox://styles/mapbox/light-v9',
39+
altitudeScale: 2,
3940
postEffect: {
4041
enable: true,
4142
screenSpaceAmbientOcclusion: {
4243
enable: true,
43-
intensity: 1.2,
44+
intensity: 2,
4445
quality: 'high',
45-
radius: 10
46+
radius: 7
4647
},
4748
screenSpaceReflection: {
4849
enable: false
4950
},
51+
depthOfField: {
52+
enable: false,
53+
blurRadius: 5,
54+
focalDistance: 80
55+
},
5056
edge: {
5157
enable: false,
52-
color: [2, 8, 16]
58+
color: [10, 2, 1]
5359
}
5460
},
5561
light: {
@@ -106,24 +112,26 @@
106112
shading: 'realistic',
107113
instancing: true,
108114
silent: true,
109-
itemStyle: {
110-
borderColor: [0, 2, 10],
111-
borderWidth: 1
112-
},
113115
realisticMaterial: {
114-
metalness: 1,
115-
roughness: 0.4,
116-
detailTexture: 'asset/iron-rusted4/iron-rusted4-basecolor.jpg',
117-
metalness: 'asset/iron-rusted4/iron-rusted4-metalness.jpg',
118-
roughness: 'asset/iron-rusted4/iron-rusted4-roughness.jpg',
119-
normalTexture: 'asset/iron-rusted4/iron-rusted4-normal.jpg',
120-
textureTiling: [10, 10]
116+
metalness: 0,
117+
roughness: 0.8,
118+
detailTexture: 'asset/woods.jpg',
119+
// detailTexture: 'asset/iron-rusted4/iron-rusted4-basecolor.jpg',
120+
// metalness: 'asset/iron-rusted4/iron-rusted4-metalness.jpg',
121+
// roughness: 'asset/iron-rusted4/iron-rusted4-roughness.jpg',
122+
// normalTexture: 'asset/iron-rusted4/iron-rusted4-normal.jpg',
123+
textureTiling: [4, 4]
121124
}
122125
}]
123126
});
124127
}
125128

129+
var requests = [];
130+
126131
function loadBuildings() {
132+
chart.hideLoading();
133+
chart.showLoading();
134+
127135
var mapbox = chart.getModel().getComponent('mapbox').getMapbox();
128136
var coordBounds = mapbox.getBounds();
129137
var merc = new SphericalMercator({
@@ -133,27 +141,35 @@
133141
[coordBounds.getWest(), coordBounds.getSouth(), coordBounds.getEast(), coordBounds.getNorth()],
134142
15
135143
);
144+
console.log(tileBounds);
136145

137146
var geoJSONList = [];
138147
var z = 15;
139148
var loadingCount = 0;
140149

150+
requests.forEach(function (req) {
151+
req.abort();
152+
});
153+
requests = [];
141154
function load(url) {
142155
var geoJSON = cache.get(url);
143156
if (geoJSON) {
144157
geoJSONList.push(geoJSON);
145158
}
146159
else {
147160
loadingCount++;
148-
$.getJSON(url).done(function (geoJSON) {
161+
var request = $.getJSON(url).done(function (geoJSON) {
149162
loadingCount--;
150163
cache.put(url, geoJSON);
151164
geoJSONList.push(geoJSON);
152165

153166
if (loadingCount === 0) {
154167
updateBuildings(geoJSONList);
155168
}
169+
170+
requests.splice(requests.indexOf(request), 1);
156171
});
172+
requests.push(request);
157173
}
158174
}
159175
for (var x = tileBounds.minX; x <= tileBounds.maxX; x++) {
@@ -186,7 +202,6 @@
186202
chart.resize();
187203
});
188204

189-
chart.showLoading();
190205

191206
loadBuildings();
192207

0 commit comments

Comments
 (0)