egovamap 0.35.39 → 0.35.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,181 +1,181 @@
1
- function isNumber(n) {
2
- return !isNaN(parseFloat(n)) && isFinite(n);
3
- }
4
-
5
- function ringIsClockwise(ringToTest) {
6
- var total = 0,
7
- i = 0;
8
- var rLength = ringToTest.length;
9
- var pt1 = ringToTest[i];
10
- var pt2;
11
- for (i; i < rLength - 1; i++) {
12
- pt2 = ringToTest[i + 1];
13
- total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
14
- pt1 = pt2;
15
- }
16
- return total >= 0;
17
- }
18
-
19
- function closeRing(coordinates) {
20
- if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {
21
- coordinates.push(coordinates[0]);
22
- }
23
- return coordinates;
24
- }
25
-
26
- // checks if 2 x,y points are equal
27
- function pointsEqual(a, b) {
28
- for (var i = 0; i < a.length; i++) {
29
- if (a[i] !== b[i]) {
30
- return false;
31
- }
32
- }
33
- return true;
34
- }
35
-
36
- function coordinatesContainPoint(coordinates, point) {
37
- var contains = false;
38
- for (var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {
39
- if (
40
- ((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||
41
- (coordinates[j][1] <= point[1] &&
42
- point[1] < coordinates[i][1])) &&
43
- point[0] <
44
- ((coordinates[j][0] - coordinates[i][0]) *
45
- (point[1] - coordinates[i][1])) /
46
- (coordinates[j][1] - coordinates[i][1]) +
47
- coordinates[i][0]
48
- ) {
49
- contains = !contains;
50
- }
51
- }
52
- return contains;
53
- }
54
-
55
- function edgeIntersectsEdge(a1, a2, b1, b2) {
56
- var ua_t =
57
- (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);
58
- var ub_t =
59
- (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);
60
- var u_b =
61
- (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);
62
-
63
- if (u_b !== 0) {
64
- var ua = ua_t / u_b;
65
- var ub = ub_t / u_b;
66
-
67
- if (0 <= ua && ua <= 1 && 0 <= ub && ub <= 1) {
68
- return true;
69
- }
70
- }
71
-
72
- return false;
73
- }
74
-
75
- function arraysIntersectArrays(a, b) {
76
- if (isNumber(a[0][0])) {
77
- if (isNumber(b[0][0])) {
78
- for (var i = 0; i < a.length - 1; i++) {
79
- for (var j = 0; j < b.length - 1; j++) {
80
- if (edgeIntersectsEdge(a[i], a[i + 1], b[j], b[j + 1])) {
81
- return true;
82
- }
83
- }
84
- }
85
- } else {
86
- for (var k = 0; k < b.length; k++) {
87
- if (arraysIntersectArrays(a, b[k])) {
88
- return true;
89
- }
90
- }
91
- }
92
- } else {
93
- for (var l = 0; l < a.length; l++) {
94
- if (arraysIntersectArrays(a[l], b)) {
95
- return true;
96
- }
97
- }
98
- }
99
- return false;
100
- }
101
-
102
- function coordinatesContainCoordinates(outer, inner) {
103
- var intersects = arraysIntersectArrays(outer, inner);
104
- var contains = coordinatesContainPoint(outer, inner[0]);
105
- if (!intersects && contains) {
106
- return true;
107
- }
108
- return false;
109
- }
110
-
111
- function convertRingsToGeoJSON(rings) {
112
- var outerRings = [];
113
- var holes = [];
114
- var x;
115
- var outerRing;
116
- var hole;
117
-
118
- for (var r = 0; r < rings.length; r++) {
119
- var ring = closeRing(rings[r].slice(0));
120
- if (ring.length < 4) {
121
- continue;
122
- }
123
-
124
- if (ringIsClockwise(ring)) {
125
- var polygon = [ring.slice().reverse()];
126
- outerRings.push(polygon);
127
- } else {
128
- holes.push(ring.slice().reverse());
129
- }
130
- }
131
-
132
- var uncontainedHoles = [];
133
-
134
- while (holes.length) {
135
- hole = holes.pop();
136
- var contained = false;
137
- for (x = outerRings.length - 1; x >= 0; x--) {
138
- outerRing = outerRings[x][0];
139
- if (coordinatesContainCoordinates(outerRing, hole)) {
140
- outerRings[x].push(hole);
141
- contained = true;
142
- break;
143
- }
144
- }
145
-
146
- if (!contained) {
147
- uncontainedHoles.push(hole);
148
- }
149
- }
150
-
151
- while (uncontainedHoles.length) {
152
- hole = uncontainedHoles.pop();
153
-
154
- var intersects = false;
155
- for (x = outerRings.length - 1; x >= 0; x--) {
156
- outerRing = outerRings[x][0];
157
- if (arraysIntersectArrays(outerRing, hole)) {
158
- outerRings[x].push(hole);
159
- intersects = true;
160
- break;
161
- }
162
- }
163
-
164
- if (!intersects) {
165
- outerRings.push([hole.reverse()]);
166
- }
167
- }
168
-
169
- if (outerRings.length === 1) {
170
- return {
171
- type: "Polygon",
172
- coordinates: outerRings[0],
173
- };
174
- } else {
175
- return {
176
- type: "MultiPolygon",
177
- coordinates: outerRings,
178
- };
179
- }
180
- }
181
- export default convertRingsToGeoJSON;
1
+ function isNumber(n) {
2
+ return !isNaN(parseFloat(n)) && isFinite(n);
3
+ }
4
+
5
+ function ringIsClockwise(ringToTest) {
6
+ var total = 0,
7
+ i = 0;
8
+ var rLength = ringToTest.length;
9
+ var pt1 = ringToTest[i];
10
+ var pt2;
11
+ for (i; i < rLength - 1; i++) {
12
+ pt2 = ringToTest[i + 1];
13
+ total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
14
+ pt1 = pt2;
15
+ }
16
+ return total >= 0;
17
+ }
18
+
19
+ function closeRing(coordinates) {
20
+ if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {
21
+ coordinates.push(coordinates[0]);
22
+ }
23
+ return coordinates;
24
+ }
25
+
26
+ // checks if 2 x,y points are equal
27
+ function pointsEqual(a, b) {
28
+ for (var i = 0; i < a.length; i++) {
29
+ if (a[i] !== b[i]) {
30
+ return false;
31
+ }
32
+ }
33
+ return true;
34
+ }
35
+
36
+ function coordinatesContainPoint(coordinates, point) {
37
+ var contains = false;
38
+ for (var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {
39
+ if (
40
+ ((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1]) ||
41
+ (coordinates[j][1] <= point[1] &&
42
+ point[1] < coordinates[i][1])) &&
43
+ point[0] <
44
+ ((coordinates[j][0] - coordinates[i][0]) *
45
+ (point[1] - coordinates[i][1])) /
46
+ (coordinates[j][1] - coordinates[i][1]) +
47
+ coordinates[i][0]
48
+ ) {
49
+ contains = !contains;
50
+ }
51
+ }
52
+ return contains;
53
+ }
54
+
55
+ function edgeIntersectsEdge(a1, a2, b1, b2) {
56
+ var ua_t =
57
+ (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);
58
+ var ub_t =
59
+ (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);
60
+ var u_b =
61
+ (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);
62
+
63
+ if (u_b !== 0) {
64
+ var ua = ua_t / u_b;
65
+ var ub = ub_t / u_b;
66
+
67
+ if (0 <= ua && ua <= 1 && 0 <= ub && ub <= 1) {
68
+ return true;
69
+ }
70
+ }
71
+
72
+ return false;
73
+ }
74
+
75
+ function arraysIntersectArrays(a, b) {
76
+ if (isNumber(a[0][0])) {
77
+ if (isNumber(b[0][0])) {
78
+ for (var i = 0; i < a.length - 1; i++) {
79
+ for (var j = 0; j < b.length - 1; j++) {
80
+ if (edgeIntersectsEdge(a[i], a[i + 1], b[j], b[j + 1])) {
81
+ return true;
82
+ }
83
+ }
84
+ }
85
+ } else {
86
+ for (var k = 0; k < b.length; k++) {
87
+ if (arraysIntersectArrays(a, b[k])) {
88
+ return true;
89
+ }
90
+ }
91
+ }
92
+ } else {
93
+ for (var l = 0; l < a.length; l++) {
94
+ if (arraysIntersectArrays(a[l], b)) {
95
+ return true;
96
+ }
97
+ }
98
+ }
99
+ return false;
100
+ }
101
+
102
+ function coordinatesContainCoordinates(outer, inner) {
103
+ var intersects = arraysIntersectArrays(outer, inner);
104
+ var contains = coordinatesContainPoint(outer, inner[0]);
105
+ if (!intersects && contains) {
106
+ return true;
107
+ }
108
+ return false;
109
+ }
110
+
111
+ function convertRingsToGeoJSON(rings) {
112
+ var outerRings = [];
113
+ var holes = [];
114
+ var x;
115
+ var outerRing;
116
+ var hole;
117
+
118
+ for (var r = 0; r < rings.length; r++) {
119
+ var ring = closeRing(rings[r].slice(0));
120
+ if (ring.length < 4) {
121
+ continue;
122
+ }
123
+
124
+ if (ringIsClockwise(ring)) {
125
+ var polygon = [ring.slice().reverse()];
126
+ outerRings.push(polygon);
127
+ } else {
128
+ holes.push(ring.slice().reverse());
129
+ }
130
+ }
131
+
132
+ var uncontainedHoles = [];
133
+
134
+ while (holes.length) {
135
+ hole = holes.pop();
136
+ var contained = false;
137
+ for (x = outerRings.length - 1; x >= 0; x--) {
138
+ outerRing = outerRings[x][0];
139
+ if (coordinatesContainCoordinates(outerRing, hole)) {
140
+ outerRings[x].push(hole);
141
+ contained = true;
142
+ break;
143
+ }
144
+ }
145
+
146
+ if (!contained) {
147
+ uncontainedHoles.push(hole);
148
+ }
149
+ }
150
+
151
+ while (uncontainedHoles.length) {
152
+ hole = uncontainedHoles.pop();
153
+
154
+ var intersects = false;
155
+ for (x = outerRings.length - 1; x >= 0; x--) {
156
+ outerRing = outerRings[x][0];
157
+ if (arraysIntersectArrays(outerRing, hole)) {
158
+ outerRings[x].push(hole);
159
+ intersects = true;
160
+ break;
161
+ }
162
+ }
163
+
164
+ if (!intersects) {
165
+ outerRings.push([hole.reverse()]);
166
+ }
167
+ }
168
+
169
+ if (outerRings.length === 1) {
170
+ return {
171
+ type: "Polygon",
172
+ coordinates: outerRings[0],
173
+ };
174
+ } else {
175
+ return {
176
+ type: "MultiPolygon",
177
+ coordinates: outerRings,
178
+ };
179
+ }
180
+ }
181
+ export default convertRingsToGeoJSON;
@@ -1,7 +1,7 @@
1
- var CoordConvConfig = {
2
- coordConvert4Params:
3
- "-47363.969#-4112623.75#0.0039286694040273984#1.0000046699602922#0#116.0",
4
- coordConvert4ParamsReverse:
5
- "31175.966131687164#4112791.5852928162#-0.003850255399136165#1.0000100832629242#0#116.0",
6
- };
7
- export default CoordConvConfig;
1
+ var CoordConvConfig = {
2
+ coordConvert4Params:
3
+ "-47363.969#-4112623.75#0.0039286694040273984#1.0000046699602922#0#116.0",
4
+ coordConvert4ParamsReverse:
5
+ "31175.966131687164#4112791.5852928162#-0.003850255399136165#1.0000100832629242#0#116.0",
6
+ };
7
+ export default CoordConvConfig;
@@ -134,7 +134,7 @@ var egovaBI = function (globeMap, gisMap, mapType) {
134
134
  p.minZoom = options.common.beginLevel;
135
135
  p.maxZoom = options.common.endLevel;
136
136
  p.symbolType = -1;
137
- p.symbolUrl = options.textStyle.symbolUrl || "location.png";
137
+ p.symbolUrl = p.symbolUrl || options.textStyle.symbolUrl || "location.png";
138
138
  if (options.selected && options.selected.hSymbolUrl)
139
139
  p.hSymbolUrl = options.selected.hSymbolUrl;
140
140
  p.scale = options.textStyle.scale;
@@ -2896,6 +2896,15 @@ var EGovaGISMap = function (
2896
2896
  that.identifyV22 = function( options) {
2897
2897
  return that.callMap("identifyV22", options);
2898
2898
  }
2899
+
2900
+ that.showGeoserverVTLayer = function(id, options) {
2901
+ return that.callMap("showGeoserverVTLayer", id, options);
2902
+ }
2903
+
2904
+ that.setGeoserverVTLayer = function(id, options) {
2905
+ return that.callMap("setGeoserverVTLayer", id, options);
2906
+ }
2907
+
2899
2908
  that.init();
2900
2909
  };
2901
2910
 
@@ -1,97 +1,97 @@
1
- @import url(./mapswich.css);
2
-
3
- .fullWindow {
4
- position: absolute;
5
- top: 0;
6
- left: 0;
7
- height: 100%;
8
- width: 100%;
9
- margin: 0;
10
- overflow: hidden;
11
- padding: 0;
12
- font-family: sans-serif;
13
- }
14
-
15
- .desktop-map {
16
- width: 100%;
17
- height: 100%;
18
- overflow: hidden;
19
- margin: 0;
20
- z-index: 0;
21
- }
22
-
23
- .maps-container {
24
- overflow: hidden;
25
- margin: 0;
26
- z-index: 0;
27
- }
28
-
29
- .emap-container {
30
- position: absolute;
31
- right: 0;
32
- bottom: 0;
33
- width: 100%;
34
- height: 100%;
35
- overflow: hidden;
36
- margin: 0;
37
- }
38
-
39
- .emap-iframe {
40
- width: 100%;
41
- height: 100%;
42
- overflow: hidden;
43
- margin: 0;
44
- z-index: 0;
45
- frameborder: 0;
46
- border: 0;
47
- marginwidth: 0;
48
- marginheight: 0;
49
- }
50
-
51
- .mmsmap-container {
52
- position: absolute;
53
- top: 0;
54
- bottom: 0;
55
- width: 100%;
56
- overflow: hidden;
57
- margin: 0;
58
- z-index: 0;
59
- transition: height 0.5s;
60
- transition-timing-function: linear;
61
- display: none;
62
- }
63
-
64
- .mmsmap-iframe {
65
- width: 100%;
66
- height: 100%;
67
- overflow: hidden;
68
- margin: 0;
69
- z-index: 0;
70
- frameborder: 0;
71
- border: 0;
72
- marginwidth: 0;
73
- marginheight: 0;
74
- }
75
-
76
- .globemap-container {
77
- position: absolute;
78
- right: 0;
79
- bottom: 0;
80
- width: 100%;
81
- height: 100%;
82
- overflow: hidden;
83
- margin: 0;
84
- z-index: 0;
85
- }
86
-
87
- .globemap-iframe {
88
- width: 100%;
89
- height: 100%;
90
- overflow: hidden;
91
- margin: 0;
92
- z-index: 0;
93
- frameborder: 0;
94
- border: 0;
95
- marginwidth: 0;
96
- marginheight: 0;
97
- }
1
+ @import url(./mapswich.css);
2
+
3
+ .fullWindow {
4
+ position: absolute;
5
+ top: 0;
6
+ left: 0;
7
+ height: 100%;
8
+ width: 100%;
9
+ margin: 0;
10
+ overflow: hidden;
11
+ padding: 0;
12
+ font-family: sans-serif;
13
+ }
14
+
15
+ .desktop-map {
16
+ width: 100%;
17
+ height: 100%;
18
+ overflow: hidden;
19
+ margin: 0;
20
+ z-index: 0;
21
+ }
22
+
23
+ .maps-container {
24
+ overflow: hidden;
25
+ margin: 0;
26
+ z-index: 0;
27
+ }
28
+
29
+ .emap-container {
30
+ position: absolute;
31
+ right: 0;
32
+ bottom: 0;
33
+ width: 100%;
34
+ height: 100%;
35
+ overflow: hidden;
36
+ margin: 0;
37
+ }
38
+
39
+ .emap-iframe {
40
+ width: 100%;
41
+ height: 100%;
42
+ overflow: hidden;
43
+ margin: 0;
44
+ z-index: 0;
45
+ frameborder: 0;
46
+ border: 0;
47
+ marginwidth: 0;
48
+ marginheight: 0;
49
+ }
50
+
51
+ .mmsmap-container {
52
+ position: absolute;
53
+ top: 0;
54
+ bottom: 0;
55
+ width: 100%;
56
+ overflow: hidden;
57
+ margin: 0;
58
+ z-index: 0;
59
+ transition: height 0.5s;
60
+ transition-timing-function: linear;
61
+ display: none;
62
+ }
63
+
64
+ .mmsmap-iframe {
65
+ width: 100%;
66
+ height: 100%;
67
+ overflow: hidden;
68
+ margin: 0;
69
+ z-index: 0;
70
+ frameborder: 0;
71
+ border: 0;
72
+ marginwidth: 0;
73
+ marginheight: 0;
74
+ }
75
+
76
+ .globemap-container {
77
+ position: absolute;
78
+ right: 0;
79
+ bottom: 0;
80
+ width: 100%;
81
+ height: 100%;
82
+ overflow: hidden;
83
+ margin: 0;
84
+ z-index: 0;
85
+ }
86
+
87
+ .globemap-iframe {
88
+ width: 100%;
89
+ height: 100%;
90
+ overflow: hidden;
91
+ margin: 0;
92
+ z-index: 0;
93
+ frameborder: 0;
94
+ border: 0;
95
+ marginwidth: 0;
96
+ marginheight: 0;
97
+ }
@@ -5694,6 +5694,20 @@ var EGovaMap = function (
5694
5694
  }
5695
5695
  };
5696
5696
 
5697
+ that.showGeoserverVTLayer = function (id, options) {
5698
+ if (scene == null) return;
5699
+ if (gisMap != null) {
5700
+ gisMap.showGeoserverVTLayer.apply(this, arguments);
5701
+ }
5702
+ };
5703
+
5704
+ that.setGeoserverVTLayer = function (id, options) {
5705
+ if (scene == null) return;
5706
+ if (gisMap != null) {
5707
+ gisMap.setGeoserverVTLayer.apply(this, arguments);
5708
+ }
5709
+ };
5710
+
5697
5711
  that.initMap(containerID, callback, mapType, mapConfig, mapParam);
5698
5712
 
5699
5713
  // EGovaBI(globeMap).bind(this)();