Skip to content

Commit 9fb0101

Browse files
committed
【update】10i(2021) 优化例子 review by xiongjj
1 parent bd6f9f3 commit 9fb0101

25 files changed

+49
-76
lines changed

examples/3dwebgl/editor.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
$('.wrapper').load("../template/editor.html", function () {
2525
var navigation = {
2626
nav: {
27-
title: "SuperMap iClient 10i",
27+
title: "SuperMap iClient 10i(2021)",
2828
path: "../../web/",
2929
isLocal: window.isLocal
3030
}

examples/3dwebgl/examples.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
$('.wrapper').load("../template/example.html", function () {
2727
var navigation = {
2828
nav: {
29-
title: "SuperMap iClient 10i",
29+
title: "SuperMap iClient 10i(2021)",
3030
path: "../../web/",
3131
isLocal: window.isLocal
3232
}

examples/classic/editor-wechat.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
$('.wrapper').load('../template/editor.html', function() {
4545
var navigation = {
4646
nav: {
47-
title: 'SuperMap iClient 10i',
47+
title: 'SuperMap iClient 10i(2021)',
4848
path: '../../web/',
4949
isLocal: window.isLocal
5050
}

examples/classic/editor.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
$('.wrapper').load("../template/editor.html", function () {
2525
var navigation = {
2626
nav: {
27-
title: "SuperMap iClient 10i",
27+
title: "SuperMap iClient 10i(2021)",
2828
path: "../../web/",
2929
isLocal: window.isLocal
3030
}

examples/classic/examples-wechat.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
$('.wrapper').load('../template/example.html', function() {
6767
var navigation = {
6868
nav: {
69-
title: 'SuperMap iClient 10i',
69+
title: 'SuperMap iClient 10i(2021)',
7070
path: '../../web/',
7171
isLocal: window.isLocal
7272
}

examples/classic/examples.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
$('.wrapper').load("../template/example.html", function () {
2727
var navigation = {
2828
nav: {
29-
title: "SuperMap iClient 10i",
29+
title: "SuperMap iClient 10i(2021)",
3030
path: "../../web/",
3131
isLocal: window.isLocal
3232
}

examples/component/components_ncp_china_vue.html

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
99
<title></title>
1010
</head>
11-
12-
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
11+
<body style="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0;">
1312
<div id="main">
1413
<sm-web-map :map-options="mapOptions" @load="mapLoaded" @click="mapClicked"></sm-web-map>
1514
<div id="group">
@@ -38,7 +37,7 @@
3837
<sm-image
3938
repeat="noRepeat"
4039
src="../img/online-qr.png"
41-
style="position: absolute; bottom: 32px;right: 16px;z-index: 1000;height: 88px;width: 88px;"
40+
style="position: absolute; bottom: 32px; right: 16px; z-index: 1000; height: 88px; width: 88px;"
4241
></sm-image>
4342
</div>
4443
<script type="text/javascript" include="vue" src="../js/include-web.js"></script>
@@ -82,16 +81,6 @@
8281
.ant-radio-button-wrapper-checked:first-child {
8382
color: #1890ff;
8483
}
85-
.sm-component-indicator {
86-
padding-left: 0px;
87-
}
88-
.sm-component-text {
89-
margin-top: -16px;
90-
}
91-
.sm-component-count-to__numItem {
92-
letter-spacing: 0 !important;
93-
text-indent: 1px !important;
94-
}
9584
@media screen and (max-width: 768px) {
9685
.sm-component-count-to__numItem {
9786
font-size: 32px !important;
@@ -105,9 +94,6 @@
10594
.sm-component-text {
10695
font-size: 16px !important;
10796
}
108-
.sm-component-text {
109-
margin-top: -10px;
110-
}
11197
#group {
11298
margin-top: 28px;
11399
}
@@ -122,7 +108,7 @@
122108
<script>
123109
var styles = {
124110
'china-riskLevel': {
125-
tooltip: function(properties) {
111+
tooltip: function (properties) {
126112
if (properties.daysNoConfirmedAdd >= 3) {
127113
return resources.text_ncp_riskLevel_tooltip
128114
.replace('{name}', properties['省份'])
@@ -156,7 +142,7 @@
156142
'line-color': '#5F5F5F'
157143
},
158144
'china-incrementConfirmed': {
159-
tooltip: function(properties) {
145+
tooltip: function (properties) {
160146
if (isNaN(properties['confirmedAdd'])) {
161147
return resources.text_ncp_nodata_tooltip.replace('{name}', properties['省份']);
162148
}
@@ -192,7 +178,7 @@
192178
'line-color': '#83838D'
193179
},
194180
'china-nowConfirmed': {
195-
tooltip: function(properties) {
181+
tooltip: function (properties) {
196182
if (isNaN(properties['nowConfirmed'])) {
197183
return resources.text_ncp_nodata_tooltip.replace('{name}', properties['省份']);
198184
}
@@ -224,7 +210,7 @@
224210
'line-color': '#83838D'
225211
},
226212
'china-incidence': {
227-
tooltip: function(properties) {
213+
tooltip: function (properties) {
228214
return resources.text_ncp_incidence_tooltip
229215
.replace('{name}', properties['省份'])
230216
.replace('{incidence}', properties['incidence'])
@@ -260,7 +246,7 @@
260246

261247
return {
262248
type: 'china-riskLevel',
263-
time: '',
249+
time: '04/01 24:00',
264250
nums: {
265251
'china-incrementConfirmed': 0,
266252
'china-nowConfirmed': 0,
@@ -331,7 +317,7 @@
331317
});
332318
$.get(
333319
'https://ncpviz.oss-cn-beijing.aliyuncs.com/ncpviz/ui.json?time=' + new Date().getTime(),
334-
function(response) {
320+
function (response) {
335321
document.title = getTitle(response);
336322
}
337323
);
@@ -341,8 +327,8 @@
341327
this.map = e.map;
342328
$.get(
343329
'https://ncpviz.oss-cn-beijing.aliyuncs.com/ncpviz/ncp.json?time=' + new Date().getTime(),
344-
function(response) {
345-
this.time = resources.text_ncp_time.replace('{time}', response.time);
330+
function (response) {
331+
// this.time = resources.text_ncp_time.replace('{time}', response.time);
346332
var latestProvinceData = this.getLatestProvinceData(response);
347333
this.map.addSource('china', {
348334
type: 'geojson',
@@ -447,7 +433,7 @@
447433
getLatestProvinceData(response) {
448434
var unit = 100000; //单位为10万
449435
var dataByName = {};
450-
ProvincesCenterData.features.forEach(provinceData => {
436+
ProvincesCenterData.features.forEach((provinceData) => {
451437
dataByName[provinceData.properties['省份']] = provinceData;
452438
});
453439
var dataExcludeNational = response.data.slice(1);
@@ -456,26 +442,26 @@
456442
var provinceLabelData = [];
457443
var provinceName = [];
458444
var daysNoConfirmedAdd = [];
459-
dataExcludeNational.forEach(data => {
460-
if (data.provinces[0].provinceData && data.provinces[0].provinceData.properties) {
461-
var name = data.provinces[0].provinceData.provinceName;
445+
dataExcludeNational.forEach((data) => {
446+
if (data.provinces[1].provinceData && data.provinces[1].provinceData.properties) {
447+
var name = data.provinces[1].provinceData.provinceName;
462448
provinceName.push(name);
463-
daysNoConfirmedAdd.push(data.provinces[0].provinceData.properties.daysNoConfirmedAdd);
449+
daysNoConfirmedAdd.push(data.provinces[1].provinceData.properties.daysNoConfirmedAdd);
464450
// 计算连续三日最高的新增确诊数
465-
if (data.provinces[0].provinceData.properties.confirmedAdd != null) {
451+
if (data.provinces[1].provinceData.properties.confirmedAdd != null) {
466452
var latest3DaysConfiredInrement = data.provinces
467-
.slice(0, 3)
468-
.map(e => e.provinceData.properties.confirmedAdd);
469-
data.provinces[0].provinceData.properties.daysMaxConfirmedAdd = Math.max(
453+
.slice(1, 4)
454+
.map((e) => e.provinceData.properties.confirmedAdd);
455+
data.provinces[1].provinceData.properties.daysMaxConfirmedAdd = Math.max(
470456
latest3DaysConfiredInrement[0],
471457
latest3DaysConfiredInrement[1],
472458
latest3DaysConfiredInrement[2]
473459
);
474460
} else {
475-
delete data.provinces[0].provinceData.properties.daysNoConfirmedAdd;
461+
delete data.provinces[1].provinceData.properties.daysNoConfirmedAdd;
476462
}
477463

478-
var confirmed = data.provinces[0].provinceData.properties.confirmed;
464+
var confirmed = data.provinces[1].provinceData.properties.confirmed;
479465
var confirmedAbsent = false;
480466
if (confirmed == null) {
481467
confirmed = data.provinces[1].provinceData.properties.confirmed;
@@ -485,16 +471,16 @@
485471
var incidence = (confirmed / population) * unit;
486472
incidence = Number(incidence.toFixed(2));
487473
if (!confirmedAbsent) {
488-
data.provinces[0].provinceData.properties.incidence = incidence;
474+
data.provinces[1].provinceData.properties.incidence = incidence;
489475
}
490-
data.provinces[0].provinceData.properties.population = population;
476+
data.provinces[1].provinceData.properties.population = population;
491477
// provinceIncidence.push(incidence);
492-
var toPush = Object.assign(data.provinces[0].provinceData);
478+
var toPush = Object.assign(data.provinces[1].provinceData);
493479
// latestProvinceData.push(toPush);
494-
var province = ProvinceData.features.find(function(item) {
480+
var province = ProvinceData.features.find(function (item) {
495481
return item.properties.Name === name || item.properties.Name.indexOf(name) === 0;
496482
});
497-
var provinceLabel = ProvincesCenterData.features.find(function(item) {
483+
var provinceLabel = ProvincesCenterData.features.find(function (item) {
498484
return (
499485
item.properties['省份'] === name || item.properties['省份'].indexOf(name) === 0
500486
);

examples/component/components_ncp_world_vue.html

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,6 @@
8383
.ant-radio-button-wrapper-checked:first-child {
8484
color: #1890ff;
8585
}
86-
.sm-component-indicator {
87-
padding-left: 0px;
88-
}
89-
.sm-component-text {
90-
margin-top: -16px;
91-
}
92-
.sm-component-count-to__numItem {
93-
letter-spacing: 0 !important;
94-
text-indent: 1px !important;
95-
}
9686
@media screen and (max-width: 768px) {
9787
.sm-component-count-to__numItem {
9888
font-size: 32px !important;
@@ -106,9 +96,6 @@
10696
.sm-component-text {
10797
font-size: 16px !important;
10898
}
109-
.sm-component-text {
110-
margin-top: -10px;
111-
}
11299
.ant-radio-group-large .ant-radio-button-wrapper {
113100
height: 32px;
114101
line-height: 30px;

examples/component/editor-wechat.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
$('.wrapper').load('../template/editor.html', function() {
5252
var navigation = {
5353
nav: {
54-
title: 'SuperMap iClient 10i',
54+
title: 'SuperMap iClient 10i(2021)',
5555
path: '../../web/',
5656
isLocal: window.isLocal
5757
}

examples/component/editor.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
$('.wrapper').load("../template/editor.html", function () {
2525
var navigation = {
2626
nav: {
27-
title: "SuperMap iClient 10i",
27+
title: "SuperMap iClient 10i(2021)",
2828
path: "../../web/",
2929
isLocal: window.isLocal
3030
}

0 commit comments

Comments
 (0)