Skip to content

Commit fb24635

Browse files
committed
openlayers对接webmap 修改GeoJSON修复openlayers显示线缺失点的问题
1 parent ce17af9 commit fb24635

File tree

11 files changed

+1435
-931
lines changed

11 files changed

+1435
-931
lines changed

build/deps.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ var deps = {
106106
"name": "WMTS服务",
107107
"src": ["./src/leaflet/mapping/TileLayer.WMTS.js"]
108108
},
109-
"Portal": {
109+
"iPortal": {
110110
"name": "iPortal webmap",
111111
"src": ["./src/leaflet/mapping/WebMap.js"]
112112
}
@@ -216,6 +216,10 @@ var deps = {
216216
"SuperMapCloud": {
217217
"name": "超图云图层",
218218
"src": ['./src/openlayers/mapping/SuperMapCloud.js']
219+
},
220+
"iPortal": {
221+
"name": "iPortal webmap",
222+
"src": ["./src/openlayers/mapping/WebMap.js"]
219223
}
220224
},
221225
"services": {

dist/iclient9-leaflet.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,14 +1326,18 @@
13261326
/* 6 */
13271327
/***/ (function(module, exports, __webpack_require__) {
13281328

1329+
/* COPYRIGHT 2017 SUPERMAP
1330+
* 本程序只能在有效的授权许可下使用。
1331+
* 未经许可,不得以任何手段擅自使用或传播。*/
1332+
1333+
13291334
/**
13301335
* Class: SuperMap.Format.GeoJSON
13311336
* GeoJSON 的读和写。使用 <SuperMap.Format.GeoJSON> 构造器创建一个GeoJSON解析器.
13321337
*
13331338
* Inherits from:
13341339
* - <SuperMap.Format.JSON>
13351340
*/
1336-
13371341
__webpack_require__(7);
13381342

13391343
SuperMap.Format.GeoJSON = SuperMap.Class(SuperMap.Format.JSON, {
@@ -2074,10 +2078,10 @@
20742078
return null;
20752079
}
20762080
if (len === 1) {
2077-
return {type: "Point", x: geoPoints[0].x, y: geoPoints[0].y};
2081+
return {type: "Point", x: parseFloat(geoPoints[0].x), y: parseFloat(geoPoints[0].y)};
20782082
} else {
20792083
for (var i = 0, pointList = []; i < len; i++) {
2080-
pointList.push({x: geoPoints[i].x, y: geoPoints[i].y});
2084+
pointList.push({x: parseFloat(geoPoints[i].x), y: parseFloat(geoPoints[i].y)});
20812085
}
20822086
return {type: "MultiPoint", components: pointList};
20832087
}
@@ -2098,7 +2102,7 @@
20982102
}
20992103
if (len === 1) {
21002104
for (var i = 0, pointList = []; i < geoParts[0]; i++) {
2101-
pointList.push({x: geoPoints[i].x, y: geoPoints[i].y});
2105+
pointList.push({x: parseFloat(geoPoints[i].x), y: parseFloat(geoPoints[i].y)});
21022106
}
21032107
//判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
21042108
if (me.isPointsEquals(pointList[0], pointList[geoParts[0] - 1])) {
@@ -2109,7 +2113,7 @@
21092113
} else {
21102114
for (var i = 0, lineList = []; i < len; i++) {
21112115
for (var j = 0, pointList = []; j < geoParts[i]; j++) {
2112-
pointList.push({x: geoPoints[j].x, y: geoPoints[j].y});
2116+
pointList.push({x: parseFloat(geoPoints[j].x), y: parseFloat(geoPoints[j].y)});
21132117
}
21142118
lineList.push(pointList);
21152119
geoPoints.splice(0, geoParts[i]);
@@ -2135,7 +2139,10 @@
21352139
}
21362140
for (var i = 0, pointIndex = 0, pointList = []; i < len; i++) {
21372141
for (var j = 0; j < geoParts[i]; j++) {
2138-
pointList.push({x: geoPoints[pointIndex + j].x, y: geoPoints[pointIndex + j].y});
2142+
pointList.push({
2143+
x: parseFloat(geoPoints[pointIndex + j].x),
2144+
y: parseFloat(geoPoints[pointIndex + j].y)
2145+
});
21392146
}
21402147
pointIndex += geoParts[i];
21412148
//判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
@@ -2164,7 +2171,10 @@
21642171
var polygonArray = new Array();
21652172
for (var i = 0, pointIndex = 0, pointList = []; i < len; i++) {
21662173
for (var j = 0; j < geoParts[i]; j++) {
2167-
pointList.push({x: geoPoints[pointIndex + j].x, y: geoPoints[pointIndex + j].y});
2174+
pointList.push({
2175+
x: parseFloat(geoPoints[pointIndex + j].x),
2176+
y: parseFloat(geoPoints[pointIndex + j].y)
2177+
});
21682178
}
21692179

21702180
pointIndex += geoParts[i];

0 commit comments

Comments
 (0)