egovamap 0.35.20 → 0.35.21

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;
@@ -2862,6 +2862,14 @@ var EGovaGISMap = function (
2862
2862
  return that.callMap("removeOverlayImageLayer", id);
2863
2863
  }
2864
2864
 
2865
+ that.addAnimatedLines = function(data, options) {
2866
+ return that.callMap("addAnimatedLines", data, options);
2867
+ }
2868
+
2869
+ that.addBackgroundCircle = function(data, options) {
2870
+ return that.callMap("addBackgroundCircle", data, options);
2871
+ }
2872
+
2865
2873
  that.init();
2866
2874
  };
2867
2875
 
@@ -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
+ }
@@ -5636,6 +5636,20 @@ var EGovaMap = function (
5636
5636
  }
5637
5637
  };
5638
5638
 
5639
+ that.addAnimatedLines = function(data, options) {
5640
+ if (scene == null) return;
5641
+ if (gisMap != null) {
5642
+ gisMap.addAnimatedLines.apply(this, arguments);
5643
+ }
5644
+ }
5645
+
5646
+ that.addBackgroundCircle = function(data, options) {
5647
+ if (scene == null) return;
5648
+ if (gisMap != null) {
5649
+ gisMap.addBackgroundCircle.apply(this, arguments);
5650
+ }
5651
+ }
5652
+
5639
5653
  that.initMap(containerID, callback, mapType, mapConfig, mapParam);
5640
5654
 
5641
5655
  // EGovaBI(globeMap).bind(this)();