Skip to content

Commit 35c35d9

Browse files
committed
2 parents 5aa2b2b + 0526d65 commit 35c35d9

File tree

8 files changed

+29
-61
lines changed

8 files changed

+29
-61
lines changed

examples/leaflet/multiphaseplay.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
}
117117

118118
function addTimeLine() {
119-
var allTime = allFeatures.map(feature => feature.time.split('/')[0]);
119+
var allTime = ['2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016'];
120120
myChart = echarts.init(document.getElementById('timeline'));
121121
var option = {
122122
timeline: {
@@ -149,8 +149,8 @@
149149
myChart.on('timelinechanged', function (params) {
150150
var url = wmsUrlCache[params.currentIndex];
151151
layer.setUrl(url);
152-
changeTimelinePlay(false);
153152
layer.once("load", changeTimelinePlay);
153+
changeTimelinePlay(false);
154154
});
155155
}
156156

examples/mapboxgl/multiphaseplay.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,15 @@
122122
}
123123

124124
function start() {
125+
map.on('sourcedata', onSourceData);
125126
addStaticImageLayer();
126-
map.on('load', addTimeLine);
127+
}
128+
129+
function onSourceData(e) {
130+
if (e.sourceId === 'static-image-layer' && e.isSourceLoaded) {
131+
map.off('sourcedata', onSourceData);
132+
addTimeLine();
133+
}
127134
}
128135

129136
function addStaticImageLayer() {
@@ -142,7 +149,7 @@
142149
}
143150

144151
function addTimeLine() {
145-
var allTime = allFeatures.map(feature => feature.time.split('/')[0]);
152+
var allTime = ['2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016'];
146153
myChart = echarts.init(document.getElementById('timeline'));
147154
var option = {
148155
timeline: {
@@ -177,8 +184,8 @@
177184
map.getSource('static-image-layer').updateImage({
178185
url: url
179186
});
180-
changeTimelinePlay(false);
181187
map.once('idle', changeTimelinePlay);
188+
changeTimelinePlay(false);
182189
});
183190
}
184191

examples/maplibregl/multiphaseplay.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,15 @@
122122
}
123123

124124
function start() {
125+
map.on('sourcedata', onSourceData);
125126
addStaticImageLayer();
126-
map.on('load', addTimeLine)
127+
}
128+
129+
function onSourceData(e) {
130+
if (e.sourceId === 'static-image-layer' && e.isSourceLoaded) {
131+
map.off('sourcedata', onSourceData);
132+
addTimeLine();
133+
}
127134
}
128135

129136
function addStaticImageLayer() {
@@ -177,8 +184,8 @@
177184
map.getSource('static-image-layer').updateImage({
178185
url: url
179186
});
180-
changeTimelinePlay(false);
181187
map.once('idle', changeTimelinePlay);
188+
changeTimelinePlay(false);
182189
});
183190
}
184191

examples/openlayers/multiphaseplay.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
}
136136

137137
function addTimeLine() {
138-
var allTime = allFeatures.map(feature => feature.time.split('/')[0]);
138+
var allTime = ['2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016'];
139139
myChart = echarts.init(document.getElementById('timeline'));
140140
var option = {
141141
timeline: {

src/common/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
"@antv/g2": "^4.2.11",
1818
"@antv/g6": "^4.8.14",
1919
"@supermapgis/tile-decryptor": "^1.0.0",
20+
"@turf/center": "^6.5.0",
2021
"@turf/meta": "^6.5.0",
2122
"echarts": "5.5.0",
2223
"fast-xml-parser": "^4.2.7",
2324
"fetch-ie8": "1.5.0",
2425
"fetch-jsonp": "1.1.3",
2526
"flatgeobuf": "3.31.1",
2627
"insert-css": "^2.0.0",
28+
"lodash.debounce": "^4.0.8",
2729
"promise-polyfill": "8.2.3",
2830
"lodash.topairs": "4.3.0",
2931
"lodash.uniqby": "^4.7.0",

src/mapboxgl/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"@supermapgis/iclient-common": "11.3.0",
2525
"canvg": "3.0.10",
2626
"flatgeobuf": "3.31.1",
27-
"lodash.debounce": "^4.0.8",
2827
"rbush": "^2.0.2",
2928
"proj4": "2.11.0",
3029
"flv.js": "^1.6.2",

src/maplibregl/L7Layerfunc.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

test/mapboxgl/mapping/WebMapV2Spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,11 +1414,14 @@ describe('mapboxgl_WebMapV2', () => {
14141414
datavizWebmap.on('mapcreatesucceeded', callback);
14151415
});
14161416

1417-
it('updateOverlayLayer featureProjection', (done) => {
1417+
xit('updateOverlayLayer featureProjection', (done) => {
14181418
spyOn(FetchRequest, 'get').and.callFake((url) => {
14191419
if (url.indexOf('portal.json') > -1) {
14201420
return Promise.resolve(new Response(JSON.stringify(iportal_serviceProxy)));
14211421
} else if (url.indexOf('1788054202/map.json') > -1) {
1422+
uniqueLayer_polygon.layers.map(item => {
1423+
item.projection='EPSG:3857'
1424+
})
14221425
return Promise.resolve(new Response(JSON.stringify(uniqueLayer_polygon)));
14231426
} else if (url.indexOf('datas/1960447494/content.json') > -1) {
14241427
return Promise.resolve(new Response(layerData_CSV));
@@ -1434,7 +1437,7 @@ describe('mapboxgl_WebMapV2', () => {
14341437
{ id: uniqueLayer_polygon.layers[0].name, projection: 'EPSG:3857' },
14351438
{
14361439
type: 'FeatureCollection',
1437-
features: [{ type: 'Feature', geometry: { type: 'Point', coordinates: [110, 10] } }]
1440+
features: [{ type: 'Feature', geometry: { type: 'Point', coordinates: [110, 10] }, properties: {} }]
14381441
},
14391442
'',
14401443
'EPSG:4326'

0 commit comments

Comments
 (0)