Skip to content

Commit ea8c05d

Browse files
committed
【update】 升级 xlsx, d3, ol3-echarts, proj4; review by luox
1 parent baf207a commit ea8c05d

18 files changed

+59
-56
lines changed

dist/leaflet/include-leaflet.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
var excludes = (targetScript.getAttribute('exclude') || '').split(',');
5555
// 在线
5656
if (!inArray(excludes, 'leaflet')) {
57-
inputCSS('https://iclient.supermap.io/web/libs/leaflet/1.7.1/leaflet.css');
58-
inputScript('https://iclient.supermap.io/web/libs/leaflet/1.7.1/leaflet.js');
57+
inputCSS('https://iclient.supermap.io/web/libs/leaflet/1.7.1/leaflet.css');
58+
inputScript('https://iclient.supermap.io/web/libs/leaflet/1.7.1/leaflet.js');
5959
}
6060
if (inArray(includes, 'mapbox-gl-enhance')) {
6161
inputCSS('https://iclient.supermap.io/web/libs/mapbox-gl-js-enhance/1.12.0/mapbox-gl-enhance.css');
@@ -74,8 +74,8 @@
7474
inputScript('https://iclient.supermap.io/web/libs/leaflet/plugins/leaflet.draw/1.0.4/leaflet.draw.js');
7575
}
7676
if (inArray(includes, 'leaflet-geoman')) {
77-
inputCSS('https://iclient.supermap.io/web/libs/leaflet/plugins/leaflet-geoman/2.11.3/leaflet-geoman.css');
78-
inputScript('https://iclient.supermap.io/web/libs/leaflet/plugins/leaflet-geoman/2.11.3/leaflet-geoman.min.js');
77+
inputCSS('https://iclient.supermap.io/web/libs/leaflet/plugins/leaflet-geoman/2.11.3/leaflet-geoman.css');
78+
inputScript('https://iclient.supermap.io/web/libs/leaflet/plugins/leaflet-geoman/2.11.3/leaflet-geoman.min.js');
7979

8080
}
8181
if (inArray(includes, 'leaflet.miniMap')) {
@@ -95,14 +95,14 @@
9595
inputScript('https://iclient.supermap.io/web/libs/elasticsearch/16.7.1/elasticsearch.min.js');
9696
}
9797
if (inArray(includes, 'xlsx')) {
98-
inputScript('https://iclient.supermap.io/web/libs/xlsx/0.18.0/xlsx.core.min.js');
98+
inputScript('https://iclient.supermap.io/web/libs/xlsx/0.18.5/xlsx.core.min.js');
9999
}
100100
// 本地
101101
if (inArray(includes, 'leaflet.sidebyside')) {
102102
inputScript('https://iclient.supermap.io/web/libs/leaflet/plugins/leaflet-side-by-side/leaflet-side-by-side.min.js');
103103
}
104104
if (inArray(includes, 'd3')) {
105-
inputScript('https://iclient.supermap.io/web/libs/d3/7.0.3/d3.min.js');
105+
inputScript('https://iclient.supermap.io/web/libs/d3/7.4.4/d3.min.js');
106106
}
107107
if (inArray(includes, 'd3-hexbin')) {
108108
inputScript('https://iclient.supermap.io/web/libs/d3/d3-hexbin.v0.2.min.js');
@@ -166,7 +166,7 @@
166166
if (inArray(includes, 'leaflet-mapbox-gl')) {
167167
inputScript('https://iclient.supermap.io/web/libs/leaflet-mapbox-gl/0.0.15/leaflet-mapbox-gl.min.js');
168168
}
169-
169+
170170
}
171171

172172
load();

dist/mapboxgl/include-mapboxgl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@
102102
inputScript('https://iclient.supermap.io/web/libs/three/0.121.1/build/three.js');
103103
}
104104
if (inArray(includes, 'xlsx')) {
105-
inputScript('https://iclient.supermap.io/web/libs/xlsx/0.18.0/xlsx.core.min.js');
105+
inputScript('https://iclient.supermap.io/web/libs/xlsx/0.18.5/xlsx.core.min.js');
106106
}
107107
if (inArray(includes, 'proj4')) {
108-
inputScript('https://iclient.supermap.io/web/libs/proj4/2.7.5/proj4.js');
108+
inputScript('https://iclient.supermap.io/web/libs/proj4/2.8.0/proj4.js');
109109
}
110110
if (inArray(includes, 'shapefile')) {
111111
inputScript('https://iclient.supermap.io/web/libs/shapefile/shapefile.js');

dist/ol/include-ol.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
inputScript('https://iclient.supermap.io/web/libs/echarts/4.9.0/echarts.min.js');
7676
}
7777
if (inArray(includes, 'proj4')) {
78-
inputScript('https://iclient.supermap.io/web/libs/proj4/2.7.5/proj4.js');
78+
inputScript('https://iclient.supermap.io/web/libs/proj4/2.8.0/proj4.js');
7979
}
8080
if (inArray(includes, 'ol3-echarts')) {
81-
inputScript('https://iclient.supermap.io/web/libs/openlayers/ol3-echarts/2.0.4/ol3Echarts.min.js');
81+
inputScript('https://iclient.supermap.io/web/libs/openlayers/ol3-echarts/2.0.6/ol3Echarts.min.js');
8282
}
8383
if (inArray(includes, '[email protected]')) {
8484
inputScript('https://iclient.supermap.io/web/libs/openlayers/ol3-echarts/1.3.6/ol3Echarts.min.js');
@@ -111,6 +111,9 @@
111111
if (inArray(includes, 'tensorflow')) {
112112
inputScript('https://iclient.supermap.io/web/libs/tensorflow/3.9.0/tf.min.js');
113113
}
114+
if (inArray(includes, 'xlsx')) {
115+
inputScript('https://iclient.supermap.io/web/libs/xlsx/0.18.5/xlsx.core.min.js');
116+
}
114117

115118
// dist
116119
if (!inArray(excludes, 'iclient-ol')) {

dist/openlayers/include-openlayers.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
inputScript('https://iclient.supermap.io/web/libs/echarts/4.9.0/echarts.min.js');
7676
}
7777
if (inArray(includes, 'proj4')) {
78-
inputScript('https://iclient.supermap.io/web/libs/proj4/2.7.5/proj4.js');
78+
inputScript('https://iclient.supermap.io/web/libs/proj4/2.8.0/proj4.js');
7979
}
8080
if (inArray(includes, 'ol3-echarts')) {
81-
inputScript('https://iclient.supermap.io/web/libs/openlayers/ol3-echarts/2.0.4/ol3Echarts.min.js');
81+
inputScript('https://iclient.supermap.io/web/libs/openlayers/ol3-echarts/2.0.6/ol3Echarts.min.js');
8282
}
8383
if (inArray(includes, '[email protected]')) {
8484
inputScript('https://iclient.supermap.io/web/libs/openlayers/ol3-echarts/1.3.6/ol3Echarts.min.js');
@@ -111,6 +111,9 @@
111111
if (inArray(includes, 'tensorflow')) {
112112
inputScript('https://iclient.supermap.io/web/libs/tensorflow/3.9.0/tf.min.js');
113113
}
114+
if (inArray(includes, 'xlsx')) {
115+
inputScript('https://iclient.supermap.io/web/libs/xlsx/0.18.5/xlsx.core.min.js');
116+
}
114117

115118
// dist
116119
if (!inArray(excludes, 'iclient-openlayers')) {

examples/leaflet/02_editFeatures.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
closeClearListener();
113113
var xmax = 120, xmin = 100, ymax = 50, ymin = 20,
114114
point = [];
115-
if (!featureGroup.hasLayer(marker)) {
115+
if (!marker || !featureGroup.hasLayer(marker)) {
116116

117117
point = [
118118
Math.floor(Math.random() * (ymax - ymin + 1) + ymin),
@@ -137,7 +137,7 @@
137137

138138
function revocationMarker() {
139139
closeClearListener();
140-
if (featureGroup.hasLayer(marker)) {
140+
if (marker && featureGroup.hasLayer(marker)) {
141141
featureGroup.clearLayers();
142142
marker = null;
143143
} else {
@@ -148,7 +148,7 @@
148148
function commit() {
149149
widgets.alert.clearAlert();
150150
closeClearListener();
151-
if (featureGroup.hasLayer(marker)) {
151+
if (marker && featureGroup.hasLayer(marker)) {
152152
marker = marker.toGeoJSON();
153153
marker.properties = {POP: 1, CAPITAL: 'test'};
154154
var addFeatureParams = new L.supermap.EditFeaturesParameters({
@@ -191,7 +191,7 @@
191191
editType: "delete"
192192
});
193193
featureService.editFeatures(deleteParams, function (serviceResult) {
194-
if (serviceResult.result.succeed) {
194+
if (serviceResult.result && serviceResult.result.succeed) {
195195
if (resultLayer) {
196196
map.removeLayer(resultLayer);
197197
resultLayer = null;
@@ -218,4 +218,4 @@
218218

219219
</script>
220220
</body>
221-
</html>
221+
</html>

examples/leaflet/05_findServiceAreas.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@
5555
parameter.weights = [400 + Math.random() * 100];
5656
service.findServiceAreas(parameter, function (serviceResult) {
5757
var result = serviceResult.result;
58-
result.serviceAreaList.map(function (serviceArea) {
58+
result && result.serviceAreaList.map(function (serviceArea) {
5959
resultLayer.addLayer(L.geoJSON(serviceArea.serviceRegion));
6060
});
6161

6262
});
6363
}
6464
</script>
6565
</body>
66-
</html>
66+
</html>

examples/leaflet/imageService.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<script
1111
type="text/javascript"
12-
include="proj4,turf,leaflet-geoman"
12+
include="turf,leaflet-geoman"
1313
src="../../dist/leaflet/include-leaflet.js"
1414
></script>
1515
<style>
@@ -547,7 +547,7 @@ <h4 class="modal-title" id="myModalLabel"></h4>
547547
}
548548

549549
function removeLayer(map, layer) {
550-
if (map.hasLayer(layer)) {
550+
if (layer && map.hasLayer(layer)) {
551551
map.removeLayer(layer);
552552
}
553553
}

examples/mapboxgl/imageService.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<head>
77
<meta charset="UTF-8" />
88
<title data-i18n="resources.title_image_service"></title>
9-
10-
9+
10+
1111
<style>
1212
.sidebar-config-wrap {
1313
position: absolute;
@@ -340,7 +340,7 @@ <h4 class="modal-title" id="myModalLabel"></h4>
340340
<script type="text/javascript" include="bootstrap,jquery,widgets" src="../js/include-web.js"></script>
341341
<script
342342
type="text/javascript"
343-
include="proj4,turf,draw,mapbox-gl-enhance,mapboxgl-draw-rectangle-drag"
343+
include="turf,draw,mapbox-gl-enhance,mapboxgl-draw-rectangle-drag"
344344
src="../../dist/mapboxgl/include-mapboxgl.js"
345345
></script>
346346
<script type="text/javascript">

examples/mapboxgl/mapvCsvcar_4326.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626

2727
<body>
2828
<div id='map'></div>
29-
<script type="text/javascript" include='mapbox-gl-enhance,mapv,proj4' src="../../dist/mapboxgl/include-mapboxgl.js"></script>
29+
<script type="text/javascript" include='mapbox-gl-enhance,mapv' src="../../dist/mapboxgl/include-mapboxgl.js"></script>
3030

3131
<script type="text/javascript">
3232
var host = window.isLocal ? window.server : "https://iserver.supermap.io";
3333
var map = new mapboxgl.Map({
34-
container: 'map',
34+
container: 'map',
3535
style: {
3636
"version": 8,
3737
"sources": {
@@ -85,4 +85,4 @@
8585

8686
</body>
8787

88-
</html>
88+
</html>

examples/mapboxgl/mapvLayerPolyon_4326.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535

3636
<body>
3737
<div id='map'></div>
38-
<script type="text/javascript" include='mapbox-gl-enhance,mapv,proj4' src="../../dist/mapboxgl/include-mapboxgl.js"></script>
38+
<script type="text/javascript" include='mapbox-gl-enhance,mapv' src="../../dist/mapboxgl/include-mapboxgl.js"></script>
3939
<script type="text/javascript">
4040
var host = window.isLocal ? window.server : "https://iserver.supermap.io";
4141
var map = new mapboxgl.Map({
42-
container: 'map',
42+
container: 'map',
4343
style: {
4444
"version": 8,
4545
"sources": {
@@ -60,8 +60,8 @@
6060
}]
6161
},
6262
crs: mapboxgl.CRS.EPSG4326,
63-
center: [112.03027629538065, 22.095590365161783],
64-
zoom: 6
63+
center: [112.03027629538065, 22.095590365161783],
64+
zoom: 6
6565
});
6666
map.on('load', function () {
6767
$.get('../data/guang_dong.json', function (geojson) {

examples/openlayers/iPortalUploadData.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ <h5 data-i18n="resources.text_data_file"></h5>
5858
</div>
5959
<h5 data-i18n="resources.text_data_name"></h5>
6060
<input id="data-name" class='form-control' type="text" style="width: 100%;">
61-
61+
6262
<h5 data-i18n="resources.detail_iPortal_tags"></h5>
6363
<input id="data-tags" class='form-control' type="text" style="width: 100%;" data-i18n="[placeholder]resources.text_user_data">
64-
64+
6565
<div><button class="btn btn-primary col-md-offset-6" style="margin-top: 20px;" onclick="inNext()" data-i18n="resources.btn_next" id="upload-or-next"></button></div>
6666
</div>
6767
<div id="two">
@@ -74,7 +74,7 @@ <h5 data-i18n="resources.text_x_field"></h5>
7474
<div>
7575
<h5 data-i18n="resources.text_y_field"></h5>
7676
<select id="yFleid" class='form-control' >
77-
77+
7878
</select>
7979
</div>
8080
<div id="file-encoding-container">
@@ -95,7 +95,7 @@ <h5 data-i18n="resources.text_file_encoding"></h5>
9595
</div>
9696
</div>
9797
<script type="text/javascript" include="jquery,bootstrap,widgets" src="../js/include-web.js"></script>
98-
<script type="text/javascript" src="../../dist/ol/include-ol.js"></script>
98+
<script type="text/javascript" include="xlsx" src="../../dist/ol/include-ol.js"></script>
9999
<script>
100100
//iportal的URL地址 或根据情况添加自己的本地iportal地址:http://localhost:8190/iportal
101101
var iPortalUrl = "https://iportal.supermap.io/iportal";
@@ -116,7 +116,7 @@ <h5 data-i18n="resources.text_file_encoding"></h5>
116116
//初始化上传的文件名称(选择文件)
117117
uploadDataFileName = resources.text_openFile;
118118
});
119-
119+
120120
//获取token
121121
function generatePortalToken() {
122122
var serverInfo = new ol.supermap.ServerInfo(ol.supermap.ServerType.IPORTAL, {
@@ -127,7 +127,7 @@ <h5 data-i18n="resources.text_file_encoding"></h5>
127127
ol.supermap.SecurityManager.destroyToken(iPortalUrl);
128128
ol.supermap.SecurityManager.registerToken(iPortalUrl, token);
129129
}
130-
130+
131131
//选中数据类型函数
132132
function onSelectDataType(){
133133
$("#data-tags").val("");
@@ -174,7 +174,7 @@ <h5 data-i18n="resources.text_file_encoding"></h5>
174174
break;
175175
}
176176
}
177-
177+
178178
//上传文件函数
179179
$("#input_file").change(function(e){
180180
file = e.currentTarget.files[0];
@@ -198,7 +198,7 @@ <h5 data-i18n="resources.text_file_encoding"></h5>
198198
$("#data-name").val(dataName)
199199
$(".component-openfile__span").text(uploadDataFileName)
200200
})
201-
201+
202202
//获取文件名称的后缀名
203203
function getExtension(fileName) {
204204
if (!fileName) {
@@ -209,7 +209,7 @@ <h5 data-i18n="resources.text_file_encoding"></h5>
209209
}
210210
return fileName.substring(fileName.lastIndexOf('.'));
211211
}
212-
212+
213213
//下一步
214214
function inNext(){
215215
if(!file) {
@@ -236,7 +236,7 @@ <h5 data-i18n="resources.text_file_encoding"></h5>
236236
visualForm();
237237
}
238238
}
239-
239+
240240
//返回上一步
241241
function returnOnePage(){
242242
$("#one").css("display","block");
@@ -294,7 +294,7 @@ <h5 data-i18n="resources.text_file_encoding"></h5>
294294
}
295295
})
296296
}
297-
297+
298298
//解析excel csv表格数据
299299
function visualForm(){
300300
var files = {
@@ -303,7 +303,7 @@ <h5 data-i18n="resources.text_file_encoding"></h5>
303303
//解析excel csv
304304
ol.supermap.Components.FileReaderUtil.readFile(dataType,files,success,failed,context)
305305
}
306-
306+
307307
//Excel CSV数据处理成功的回调
308308
function success(res){
309309
Xfields = [];
@@ -333,11 +333,11 @@ <h5 data-i18n="resources.text_file_encoding"></h5>
333333
$("#yFleid").append("<option value='"+item+"'>"+item+"</option>");//新增
334334
})
335335
}
336-
336+
337337
//Excel CSV数据处理失败的回调
338338
function failed(res){
339339
console.log(res)
340340
}
341341
</script>
342342
</body>
343-
</html>
343+
</html>

examples/openlayers/imageService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ <h4 class="modal-title" id="myModalLabel"></h4>
333333
</div>
334334
</div>
335335
<script type="text/javascript" include="bootstrap,jquery,widgets" src="../js/include-web.js"></script>
336-
<script type="text/javascript" include="proj4,turf" src="../../dist/ol/include-ol.js"></script>
336+
<script type="text/javascript" include="turf" src="../../dist/ol/include-ol.js"></script>
337337
<script type="text/javascript">
338338
widgets.loader.showLoader("data loading...");
339339
var host = window.isLocal ? window.server : 'https://iserver.supermap.io';

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
"mapv": "2.0.62",
131131
"ol": "6.9.0",
132132
"pbf": "3.2.1",
133-
"proj4": "2.7.5",
133+
"proj4": "2.8.0",
134134
"promise-polyfill": "8.2.1",
135135
"three": "0.129.0",
136136
"xlsx": "0.18.5",

src/classic/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"license": "Apache-2.0",
1616
"dependencies": {
1717
"mapv": "2.0.62",
18-
"xlsx": "0.18.5",
1918
"@supermap/iclient-common": "11.0.0"
2019
}
2120
}

0 commit comments

Comments
 (0)