Skip to content

Commit 01d995a

Browse files
committed
openlayers 三方库及插件升级到最新版本 review by zhurc
1 parent aeff0c5 commit 01d995a

File tree

9 files changed

+321
-119
lines changed

9 files changed

+321
-119
lines changed

dist/iclient9-openlayers.js

Lines changed: 153 additions & 45 deletions
Large diffs are not rendered by default.

dist/iclient9-openlayers.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/include-openlayers.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,19 @@
3737
var includes = (targetScript.getAttribute('include') || "").split(",");
3838
var excludes = (targetScript.getAttribute('exclude') || "").split(",");
3939
if (!inArray(excludes, 'ol')) {
40-
inputCSS("https://cdn.bootcss.com/openlayers/4.6.4/ol.css");
41-
inputScript("https://cdn.bootcss.com/openlayers/4.6.4/ol.js");
40+
inputCSS("https://cdn.bootcss.com/openlayers/4.6.5/ol.css");
41+
inputScript("https://cdn.bootcss.com/openlayers/4.6.5/ol.js");
4242
}
4343
if (inArray(includes, 'mapv')) {
4444
inputScript("http://mapv.baidu.com/build/mapv.min.js");
4545
}
4646
if (inArray(includes, 'turf')) {
47-
inputScript("https://cdn.bootcss.com/Turf.js/4.6.1/turf.min.js");
47+
inputScript("https://cdn.bootcss.com/Turf.js/5.1.6/turf.min.js");
4848
}
4949
if (inArray(includes, 'ol-mapbox-style')) {
5050
inputScript("http://iclient.supermap.io/web/libs/openlayers/plugins/ol-mapbox-style/2.11.2/olms.js");
5151
}
52+
5253
if (inArray(includes, 'deck')) {
5354
inputScript("http://iclient.supermap.io/web/libs/deck.gl/5.1.3/deck.gl.js");
5455
}
@@ -59,11 +60,11 @@
5960
inputCSS("../../dist/iclient9-openlayers.min.css");
6061
}
6162
if (inArray(includes, 'echarts')) {
62-
inputScript("http://cdn.bootcss.com/echarts/4.0.4/echarts.min.js");
63+
inputScript("https://cdn.bootcss.com/echarts/4.1.0/echarts.min.js");
6364
}
6465
if (inArray(includes, 'ol3-echarts')) {
65-
inputScript("http://iclient.supermap.io/libs/openlayers/ol3-echarts/ol3Echarts.js");
66-
}
66+
inputScript("http://iclient.supermap.io/libs/openlayers/ol3-echarts/1.3.4/ol3Echarts.min.js");
67+
}
6768
if (inArray(includes, 'osmbuildings')) {
6869
inputScript("http://iclient.supermap.io/libs/osmbuildings/OSMBuildings-OL3.js");
6970
}
@@ -72,9 +73,10 @@
7273
}
7374

7475
if (inArray(includes, 'layerswitcher')) {
75-
inputCSS("http://iclient.supermap.io/libs/openlayers/plugins/ol3-layerswitcher/ol3-layerswitcher.css");
76-
inputScript("http://iclient.supermap.io/libs/openlayers/plugins/ol3-layerswitcher/ol3-layerswitcher.js");
76+
inputCSS("http://iclient.supermap.io/libs/openlayers/plugins/ol-layerswitcher/2.0.0/ol-layerswitcher.css");
77+
inputScript("http://iclient.supermap.io/libs/openlayers/plugins/ol-layerswitcher/2.0.0/ol-layerswitcher.js");
7778
}
79+
7880
}
7981

8082
load();

examples/openlayers/turf_classificationAnalysis.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<head>
44
<meta charset="UTF-8">
55
<title data-i18n="resources.title_turfClassificationAnalysis"></title>
6-
<script type="text/javascript" include="turf" src="../../dist/include-openlayers.js"></script>
76
<style>
87
.ol-popup {
98
position: absolute;
@@ -96,6 +95,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_classificationAnal
9695
</div>
9796
</div>
9897
<script type="text/javascript" include="bootstrap,widgets.alert" src="../js/include-web.js"></script>
98+
<script type="text/javascript" include="turf" src="../../dist/include-openlayers.js"></script>
9999
<script>
100100
var host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090",
101101
nearestDataUrl = host + "/iserver/services/map-china400/rest/maps/China_4326",
@@ -303,7 +303,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_classificationAnal
303303
},
304304

305305
nearestAnalyze: function (sourcePoints, coordinate) {
306-
turfSource.process("Classification.nearest", {
306+
turfSource.process("Classification.nearestPoint", {
307307
"targetPoint": [coordinate[0], coordinate[1]],
308308
"points": sourcePoints
309309
}, function (result) {

examples/openlayers/turf_gridAnalysis.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_createGrid"></h5><
5252
<p></p>
5353
<div class='input-group'>
5454
<span class='input-group-addon'><span data-i18n="resources.text_unitGridSize"></span><span data-i18n="[title]resources.text_requiredField" style='color: red;'> * </span></span>
55-
<input id='cellSize' type='text' class='form-control' value='50'/>
55+
<input id='cellSide' type='text' class='form-control' value='50'/>
5656
</div>
5757
<p></p>
5858
<div class='input-group'>
@@ -301,20 +301,20 @@ <h5 class='panel-title text-center' data-i18n="resources.text_createGrid"></h5><
301301
},
302302
//格网分析
303303
createHexGrid: function () {
304-
var cellDiameter = $("#cellSize").val();
304+
var cellSide = $("#cellSide").val();
305305
var units = $("#units option:selected").val();
306306
var triangles = $("#triangles").get(0).checked;
307307

308308
turfSource.process("Grids.hexGrid", {
309309
"bbox": bbox,
310-
"cellDiameter": cellDiameter,
310+
"cellSide": cellSide,
311311
"units": units,
312312
"triangles": triangles
313313
});
314314
},
315315

316316
createPointGrid: function () {
317-
var cellSide = $("#cellSize").val();
317+
var cellSide = $("#cellSide").val();
318318
var units = $("#units option:selected").val();
319319
var iscentered = $('#iscentered').get(0).checked;
320320
var isbboxIsMask = $('#isbboxIsMask').get(0).checked;
@@ -329,24 +329,24 @@ <h5 class='panel-title text-center' data-i18n="resources.text_createGrid"></h5><
329329
},
330330

331331
createSquareGrid: function () {
332-
var cellSize = $("#cellSize").val();
332+
var cellSide = $("#cellSide").val();
333333
var units = $("#units option:selected").val();
334334
var completelyWithin = $("#completelyWithin").get(0).checked;
335335

336336
turfSource.process("Grids.squareGrid", {
337337
"bbox": bbox,
338-
"cellSize": cellSize,
338+
"cellSide": cellSide,
339339
"units": units,
340340
"completelyWithin": completelyWithin
341341
});
342342
},
343343

344344
createTriangleGrid: function () {
345-
var cellSize = $("#cellSize").val();
345+
var cellSide = $("#cellSide").val();
346346
var units = $("#units option:selected").val();
347347
turfSource.process("Grids.triangleGrid", {
348348
"bbox": bbox,
349-
"cellSize": cellSize,
349+
"cellSide": cellSide,
350350
"units": units
351351
});
352352
},

examples/openlayers/turf_measurement.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_Jingshen"></h5>
3232
<option value='midpoint'>midpoint</option>
3333
<option value='square'>square</option>
3434
<option value='greatCircle'>greatCircle</option>
35-
<option value='bezier'>bezier</option>
35+
<option value='bezierSpline'>bezierSpline</option>
3636
<option value='buffer'>buffer</option>
3737
<option value='circle'>circle</option>
3838
</select>
@@ -338,7 +338,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_Jingshen"></h5>
338338
$('#calc').val(resources.text_getPolygon);
339339

340340
}
341-
else if (choose === 'bezier') {
341+
else if (choose === 'bezierSpline') {
342342
widgets.alert.clearAlert();
343343
$('.panel-heading>h5').text(resources.text_bezier);
344344
map.getView().animate({zoom: 12}, {
@@ -394,7 +394,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_Jingshen"></h5>
394394
"greatCircle": greatCircle,
395395
"square": square,
396396
"center": center,
397-
"bezier": bezier,
397+
"bezierSpline": bezierSpline,
398398
"buffer": buffer,
399399
"circle": circle,
400400
};
@@ -821,10 +821,10 @@ <h5 class='panel-title text-center' data-i18n="resources.text_Jingshen"></h5>
821821
}
822822
}
823823

824-
//turf bezier
825-
function bezier() {
824+
//turf bezierSpline
825+
function bezierSpline() {
826826
if (geo) {
827-
resultSource.process("Transformation.bezier", {
827+
resultSource.process("Transformation.bezierSpline", {
828828
"line": geo,
829829
"resolution": 10000,
830830
"sharpness": 0.85
@@ -846,7 +846,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_Jingshen"></h5>
846846
resultSource.process("Transformation.buffer", {
847847
"geojson": point,
848848
"radius": radius,
849-
"steps": steps,
849+
"steps": parseFloat(steps),
850850
"units": unit,
851851
});
852852
});
@@ -872,7 +872,7 @@ <h5 class='panel-title text-center' data-i18n="resources.text_Jingshen"></h5>
872872
resultSource.process("Transformation.circle", {
873873
"center": point,
874874
"radius": radius,
875-
"steps": steps,
875+
"steps": parseFloat(steps),
876876
"units": unit,
877877
"properties": {}
878878
});

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@
9999
"dependencies": {
100100
"@mapbox/vector-tile": "1.3.0",
101101
"@supermap/iclient-common": "file:src/common",
102-
"@turf/turf": "^4.7.1",
103-
"echarts": "4.0.4",
102+
"@turf/turf": "^5.1.6",
103+
"echarts": "4.1.0",
104104
"elasticsearch": "13.0.1",
105105
"express": "^4.16.3",
106106
"fetch-ie8": "^1.5.0",
@@ -109,9 +109,9 @@
109109
"leaflet": "^1.2.0",
110110
"lodash.topairs": "^4.3.0",
111111
"mapbox-gl": "0.43.0",
112-
"mapv": "2.0.14",
112+
"mapv": "2.0.20",
113113
"ol-mapbox-style": "^2.11.2",
114-
"openlayers": "^4.6.4",
114+
"openlayers": "^4.6.5",
115115
"pbf": "3.0.2",
116116
"proj4": "2.3.15",
117117
"promise-polyfill": "^6.0.2",

0 commit comments

Comments
 (0)