react-spatial 1.2.2 → 1.2.3-beta.3

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.
Files changed (186) hide show
  1. package/LayerService.js +128 -184
  2. package/LayerService.js.map +7 -1
  3. package/components/BaseLayerSwitcher/BaseLayerSwitcher.js +163 -221
  4. package/components/BaseLayerSwitcher/BaseLayerSwitcher.js.map +7 -1
  5. package/components/BaseLayerSwitcher/index.js +1 -3
  6. package/components/BaseLayerSwitcher/index.js.map +7 -1
  7. package/components/BasicMap/BasicMap.js +147 -285
  8. package/components/BasicMap/BasicMap.js.map +7 -1
  9. package/components/BasicMap/index.js +1 -3
  10. package/components/BasicMap/index.js.map +7 -1
  11. package/components/CanvasSaveButton/CanvasSaveButton.js +165 -419
  12. package/components/CanvasSaveButton/CanvasSaveButton.js.map +7 -1
  13. package/components/CanvasSaveButton/index.js +1 -3
  14. package/components/CanvasSaveButton/index.js.map +7 -1
  15. package/components/Copyright/Copyright.js +29 -70
  16. package/components/Copyright/Copyright.js.map +7 -1
  17. package/components/Copyright/index.js +1 -3
  18. package/components/Copyright/index.js.map +7 -1
  19. package/components/FeatureExportButton/FeatureExportButton.js +40 -106
  20. package/components/FeatureExportButton/FeatureExportButton.js.map +7 -1
  21. package/components/FeatureExportButton/index.js +1 -3
  22. package/components/FeatureExportButton/index.js.map +7 -1
  23. package/components/FilterButton/FilterButton.js +41 -106
  24. package/components/FilterButton/FilterButton.js.map +7 -1
  25. package/components/FilterButton/index.js +1 -3
  26. package/components/FilterButton/index.js.map +7 -1
  27. package/components/FitExtent/FitExtent.js +17 -50
  28. package/components/FitExtent/FitExtent.js.map +7 -1
  29. package/components/FitExtent/index.js +1 -3
  30. package/components/FitExtent/index.js.map +7 -1
  31. package/components/FollowButton/FollowButton.js +41 -111
  32. package/components/FollowButton/FollowButton.js.map +7 -1
  33. package/components/FollowButton/index.js +1 -3
  34. package/components/FollowButton/index.js.map +7 -1
  35. package/components/Geolocation/Geolocation.js +104 -213
  36. package/components/Geolocation/Geolocation.js.map +7 -1
  37. package/components/Geolocation/index.js +1 -3
  38. package/components/Geolocation/index.js.map +7 -1
  39. package/components/LayerTree/LayerTree.js +204 -410
  40. package/components/LayerTree/LayerTree.js.map +7 -1
  41. package/components/LayerTree/index.js +1 -3
  42. package/components/LayerTree/index.js.map +7 -1
  43. package/components/MousePosition/MousePosition.js +61 -130
  44. package/components/MousePosition/MousePosition.js.map +7 -1
  45. package/components/MousePosition/index.js +1 -3
  46. package/components/MousePosition/index.js.map +7 -1
  47. package/components/NorthArrow/NorthArrow.js +22 -62
  48. package/components/NorthArrow/NorthArrow.js.map +7 -1
  49. package/components/NorthArrow/index.js +1 -3
  50. package/components/NorthArrow/index.js.map +7 -1
  51. package/components/Overlay/Overlay.js +83 -130
  52. package/components/Overlay/Overlay.js.map +7 -1
  53. package/components/Overlay/index.js +1 -3
  54. package/components/Overlay/index.js.map +7 -1
  55. package/components/Permalink/Permalink.js +150 -244
  56. package/components/Permalink/Permalink.js.map +7 -1
  57. package/components/Permalink/index.js +1 -3
  58. package/components/Permalink/index.js.map +7 -1
  59. package/components/Popup/Popup.js +106 -233
  60. package/components/Popup/Popup.js.map +7 -1
  61. package/components/Popup/index.js +1 -3
  62. package/components/Popup/index.js.map +7 -1
  63. package/components/ResizeHandler/ResizeHandler.js +58 -113
  64. package/components/ResizeHandler/ResizeHandler.js.map +7 -1
  65. package/components/ResizeHandler/index.js +1 -3
  66. package/components/ResizeHandler/index.js.map +7 -1
  67. package/components/RouteSchedule/RouteSchedule.js +150 -283
  68. package/components/RouteSchedule/RouteSchedule.js.map +7 -1
  69. package/components/RouteSchedule/index.js +1 -3
  70. package/components/RouteSchedule/index.js.map +7 -1
  71. package/components/ScaleLine/ScaleLine.js +21 -45
  72. package/components/ScaleLine/ScaleLine.js.map +7 -1
  73. package/components/ScaleLine/index.js +1 -3
  74. package/components/ScaleLine/index.js.map +7 -1
  75. package/components/Search/Search.js +122 -186
  76. package/components/Search/Search.js.map +7 -1
  77. package/components/Search/SearchService.js +45 -69
  78. package/components/Search/SearchService.js.map +7 -1
  79. package/components/Search/engines/Engine.js +18 -25
  80. package/components/Search/engines/Engine.js.map +7 -1
  81. package/components/Search/engines/StopFinder.js +21 -38
  82. package/components/Search/engines/StopFinder.js.map +7 -1
  83. package/components/Search/index.js +3 -6
  84. package/components/Search/index.js.map +7 -1
  85. package/components/StopsFinder/StopsFinder.js +123 -174
  86. package/components/StopsFinder/StopsFinder.js.map +7 -1
  87. package/components/StopsFinder/StopsFinderOption.js +37 -54
  88. package/components/StopsFinder/StopsFinderOption.js.map +7 -1
  89. package/components/StopsFinder/index.js +1 -3
  90. package/components/StopsFinder/index.js.map +7 -1
  91. package/components/TrackerControl/TrackerControl.js +73 -128
  92. package/components/TrackerControl/TrackerControl.js.map +7 -1
  93. package/components/TrackerControl/index.js +1 -3
  94. package/components/TrackerControl/index.js.map +7 -1
  95. package/components/Zoom/Zoom.js +69 -112
  96. package/components/Zoom/Zoom.js.map +7 -1
  97. package/components/Zoom/index.js +1 -3
  98. package/components/Zoom/index.js.map +7 -1
  99. package/package.json +10 -5
  100. package/propTypes.js +17 -23
  101. package/propTypes.js.map +7 -1
  102. package/setupTests.js +2 -4
  103. package/setupTests.js.map +7 -1
  104. package/themes/README.md +26 -0
  105. package/themes/default/components.scss +0 -1
  106. package/themes/default/examples.scss +0 -1
  107. package/utils/GlobalsForOle.js +63 -64
  108. package/utils/GlobalsForOle.js.map +7 -1
  109. package/utils/KML.js +178 -364
  110. package/utils/KML.js.map +7 -1
  111. package/utils/KMLFormat.js +37 -73
  112. package/utils/KMLFormat.js.map +7 -1
  113. package/utils/Styles.js +24 -32
  114. package/utils/Styles.js.map +7 -1
  115. package/utils/getPolygonPattern.js +11 -44
  116. package/utils/getPolygonPattern.js.map +7 -1
  117. package/utils/timeUtils.js +16 -35
  118. package/utils/timeUtils.js.map +7 -1
  119. package/LayerService.test.js +0 -160
  120. package/LayerService.test.js.map +0 -1
  121. package/Projections.js +0 -16
  122. package/Projections.js.map +0 -1
  123. package/components/BaseLayerSwitcher/BaseLayerSwitcher.test.js +0 -88
  124. package/components/BaseLayerSwitcher/BaseLayerSwitcher.test.js.map +0 -1
  125. package/components/BaseLayerToggler/BaseLayerToggler.js +0 -490
  126. package/components/BaseLayerToggler/BaseLayerToggler.js.map +0 -1
  127. package/components/BaseLayerToggler/BaseLayerToggler.md.scss +0 -9
  128. package/components/BaseLayerToggler/BaseLayerToggler.scss +0 -49
  129. package/components/BaseLayerToggler/BaseLayerToggler.test.js +0 -127
  130. package/components/BaseLayerToggler/BaseLayerToggler.test.js.map +0 -1
  131. package/components/BaseLayerToggler/index.js +0 -3
  132. package/components/BaseLayerToggler/index.js.map +0 -1
  133. package/components/BasicMap/BasicMap.test.js +0 -288
  134. package/components/BasicMap/BasicMap.test.js.map +0 -1
  135. package/components/CanvasSaveButton/CanvasSaveButton.test.js +0 -173
  136. package/components/CanvasSaveButton/CanvasSaveButton.test.js.map +0 -1
  137. package/components/Copyright/Copyright.test.js +0 -133
  138. package/components/Copyright/Copyright.test.js.map +0 -1
  139. package/components/FeatureExportButton/FeatureExportButton.test.js +0 -407
  140. package/components/FeatureExportButton/FeatureExportButton.test.js.map +0 -1
  141. package/components/FilterButton/FilterButton.test.js +0 -48
  142. package/components/FilterButton/FilterButton.test.js.map +0 -1
  143. package/components/FitExtent/FitExtent.test.js +0 -44
  144. package/components/FitExtent/FitExtent.test.js.map +0 -1
  145. package/components/FollowButton/FollowButton.test.js +0 -57
  146. package/components/FollowButton/FollowButton.test.js.map +0 -1
  147. package/components/Geolocation/Geolocation.test.js +0 -263
  148. package/components/Geolocation/Geolocation.test.js.map +0 -1
  149. package/components/LayerTree/LayerTree.test.js +0 -323
  150. package/components/LayerTree/LayerTree.test.js.map +0 -1
  151. package/components/MousePosition/MousePosition.test.js +0 -125
  152. package/components/MousePosition/MousePosition.test.js.map +0 -1
  153. package/components/NorthArrow/NorthArrow.test.js +0 -106
  154. package/components/NorthArrow/NorthArrow.test.js.map +0 -1
  155. package/components/Overlay/Overlay.test.js +0 -145
  156. package/components/Overlay/Overlay.test.js.map +0 -1
  157. package/components/Permalink/Permalink.test.js +0 -267
  158. package/components/Permalink/Permalink.test.js.map +0 -1
  159. package/components/Popup/Popup.test.js +0 -291
  160. package/components/Popup/Popup.test.js.map +0 -1
  161. package/components/ResizeHandler/ResizeHandler.test.js +0 -410
  162. package/components/ResizeHandler/ResizeHandler.test.js.map +0 -1
  163. package/components/RouteSchedule/RouteSchedule.test.js +0 -102
  164. package/components/RouteSchedule/RouteSchedule.test.js.map +0 -1
  165. package/components/ScaleLine/ScaleLine.test.js +0 -32
  166. package/components/ScaleLine/ScaleLine.test.js.map +0 -1
  167. package/components/Search/Search.test.js +0 -15
  168. package/components/Search/Search.test.js.map +0 -1
  169. package/components/StopsFinder/StopsFinder.test.js +0 -19
  170. package/components/StopsFinder/StopsFinder.test.js.map +0 -1
  171. package/components/TrackerControl/TrackerControl.test.js +0 -17
  172. package/components/TrackerControl/TrackerControl.test.js.map +0 -1
  173. package/components/Zoom/Zoom.test.js +0 -150
  174. package/components/Zoom/Zoom.test.js.map +0 -1
  175. package/styleguidist/ComponentsList.js +0 -52
  176. package/styleguidist/ComponentsList.js.map +0 -1
  177. package/styleguidist/StyleGuide.js +0 -253
  178. package/styleguidist/StyleGuide.js.map +0 -1
  179. package/utils/KML.test.js +0 -163
  180. package/utils/KML.test.js.map +0 -1
  181. package/utils/KMLFormat.test.js +0 -22
  182. package/utils/KMLFormat.test.js.map +0 -1
  183. package/utils/getPolygonPattern.test.js +0 -66
  184. package/utils/getPolygonPattern.test.js.map +0 -1
  185. package/utils/timeUtils.test.js +0 -32
  186. package/utils/timeUtils.test.js.map +0 -1
package/utils/KML.test.js DELETED
@@ -1,163 +0,0 @@
1
- import VectorLayer from 'ol/layer/Vector';
2
- import VectorSource from 'ol/source/Vector';
3
- import { Style } from 'ol/style';
4
- import { get } from 'ol/proj';
5
- import beautify from 'xml-beautifier';
6
- import KML from './KML';
7
-
8
- var xmlns =
9
- 'xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd"';
10
-
11
- var expectWriteResult = function (feats, str) {
12
- expect(
13
- beautify(
14
- KML.writeFeatures(
15
- {
16
- name: 'lala',
17
- olLayer: new VectorLayer({
18
- source: new VectorSource({
19
- features: feats,
20
- }),
21
- }),
22
- },
23
- get('EPSG:4326')
24
- )
25
- )
26
- ).toEqual(beautify(str));
27
- };
28
-
29
- describe('KML', function () {
30
- describe('readFeatures() and writeFeatures()', function () {
31
- test('should read/write LineStyle and ExtendedData (linesDash, lineStartIcon and lineEndIcon).', function () {
32
- var str = "\n <kml " + xmlns + ">\n <Document>\n <name>lala</name>\n <Placemark>\n <Style>\n <LineStyle>\n <color>ff056600</color>\n <width>1</width>\n </LineStyle>\n </Style>\n <ExtendedData>\n <Data name=\"lineDash\"><value>40,40</value></Data>\n <Data name=\"lineEndIcon\"><value>{\"url\":\"fooarrowend.png\",\"scale\":0.35,\"size\":[36,58],\"zIndex\":1}</value></Data>\n <Data name=\"lineStartIcon\"><value>{\"url\":\"fooarrowstart.png\",\"scale\":0.35,\"size\":[36,58],\"zIndex\":1}</value></Data>\n </ExtendedData>\n <LineString><coordinates>0,1,0 3,5,0 40,25,0</coordinates></LineString>\n </Placemark>\n </Document>\n </kml>\n ";
33
- var feats = KML.readFeatures(str);
34
- var styles = feats[0].getStyle();
35
- expect(feats.length).toBe(1);
36
- expect(styles.length).toBe(3);
37
-
38
- // line stroke
39
- var strokeStyle = styles[0].getStroke();
40
- expect(strokeStyle.getColor()).toEqual([0, 102, 5, 1]);
41
- expect(strokeStyle.getLineDash()).toEqual([40, 40]);
42
-
43
- // line start icon
44
- var lineStartStyle = styles[1];
45
- expect(lineStartStyle.getImage().getRotation()).toEqual(
46
- -0.9272952180016122
47
- );
48
- expect(lineStartStyle.getImage().getColor()).toEqual([0, 102, 5, 1]);
49
- expect(lineStartStyle.getImage().getRotateWithView()).toBe(true);
50
- expect(lineStartStyle.getGeometry()(feats[0]).getCoordinates()).toEqual([
51
- 0, 1, 0 ]);
52
- expect(lineStartStyle.getZIndex()).toEqual(1);
53
-
54
- // line end icon
55
- var lineEndStyle = styles[2];
56
- expect(lineEndStyle.getImage().getRotation()).toEqual(
57
- -0.49555167348582857
58
- );
59
- expect(lineEndStyle.getImage().getRotateWithView()).toBe(true);
60
- expect(lineEndStyle.getImage().getColor()).toEqual([0, 102, 5, 1]);
61
- expect(lineEndStyle.getGeometry()(feats[0]).getCoordinates()).toEqual([
62
- 40, 25, 0 ]);
63
- expect(lineEndStyle.getZIndex()).toEqual(1);
64
-
65
- expectWriteResult(feats, str);
66
- });
67
-
68
- test('should read/write TextStyle and ExtendedData.', function () {
69
- var str = "\n <kml " + xmlns + ">\n <Document>\n <name>lala</name>\n <Placemark>\n <name> bar </name>\n <Style>\n <IconStyle>\n <scale>0</scale>\n </IconStyle>\n <LabelStyle>\n <color>ff7e3420</color>\n <scale>2</scale>\n </LabelStyle>\n </Style>\n <ExtendedData>\n <Data name=\"textAlign\">\n <value>right</value>\n </Data>\n <Data name=\"textBackgroundFillColor\">\n <value>rgba(255,255,255,0.01)</value>\n </Data>\n <Data name=\"textFont\">\n <value>bold 16px arial</value>\n </Data>\n <Data name=\"textOffsetX\">\n <value>-90</value>\n </Data>\n <Data name=\"textOffsetY\">\n <value>30</value>\n </Data>\n <Data name=\"textPadding\">\n <value>5,6,7,8</value>\n </Data>\n <Data name=\"textRotation\">\n <value>2.303834612632515</value>\n </Data>\n <Data name=\"textStrokeColor\">\n <value>rgba(100,255,255,0.2)</value>\n </Data>\n <Data name=\"textStrokeWidth\">\n <value>3</value>\n </Data>\n </ExtendedData>\n <Point>\n <coordinates>0,0,0</coordinates>\n </Point>\n </Placemark>\n </Document>\n </kml>\n ";
70
- var feats = KML.readFeatures(str);
71
- var style = feats[0].getStyleFunction()(feats[0], 1);
72
- expect(feats.length).toBe(1);
73
- expect(style instanceof Style).toBe(true);
74
-
75
- // Text
76
- var styleText = style.getText();
77
- expect(styleText.getText()).toBe('bar'); // spaces are trimmed.
78
- expect(styleText.getFont()).toEqual('bold 16px arial');
79
- expect(styleText.getFill()).toEqual({ color_: [32, 52, 126, 1] });
80
- expect(styleText.getStroke()).toEqual({
81
- color_: 'rgba(100,255,255,0.2)',
82
- width_: 3,
83
- lineCap_: undefined,
84
- lineDashOffset_: undefined,
85
- lineDash_: null,
86
- lineJoin_: undefined,
87
- miterLimit_: undefined,
88
- });
89
- expect(styleText.getScale()).toEqual(2);
90
- expect(styleText.getRotation()).toEqual('2.303834612632515');
91
- expect(styleText.getPadding()).toEqual([5, 6, 7, 8]);
92
- expect(styleText.getBackgroundFill()).toEqual({
93
- color_: 'rgba(255,255,255,0.01)',
94
- });
95
- expect(styleText.getTextAlign()).toEqual('right');
96
- expect(styleText.getOffsetX()).toEqual(-90);
97
- expect(styleText.getOffsetY()).toEqual(30);
98
- expectWriteResult(feats, str);
99
- });
100
-
101
- test('should read and write lineDash and fillPattern style for polygon', function () {
102
- var str = "\n <kml " + xmlns + ">\n <Document>\n <name>lala</name>\n <Placemark>\n <description></description>\n <Style>\n <LineStyle>\n <color>ff0000eb</color>\n <width>2</width>\n </LineStyle>\n <PolyStyle>\n <fill>0</fill>\n </PolyStyle>\n </Style>\n <ExtendedData>\n <Data name=\"fillPattern\">\n <value>{\"id\":3,\"color\":[235,0,0,1]}</value>\n </Data>\n <Data name=\"lineDash\">\n <value>1,1</value>\n </Data>\n </ExtendedData>\n <Polygon>\n <outerBoundaryIs>\n <LinearRing>\n <coordinates>8.521,47.381,0 8.529,47.375,0 8.531,47.382,0 8.521,47.381,0</coordinates>\n </LinearRing>\n </outerBoundaryIs>\n </Polygon>\n </Placemark>\n </Document>\n </kml>\n ";
103
- var feats = KML.readFeatures(str);
104
- var styles = feats[0].getStyle();
105
- expect(feats.length).toBe(1);
106
- expect(styles.length).toBe(1);
107
-
108
- // Polygon
109
- var feature = feats[0];
110
- var outlineStyle = styles[0].getStroke();
111
- expect(outlineStyle.getColor()).toEqual([235, 0, 0, 1]);
112
- expect(outlineStyle.getWidth()).toEqual(2);
113
- var fillStyle = styles[0].getFill();
114
- expect(feature.get('fillPattern')).toEqual({
115
- id: 3,
116
- color: [235, 0, 0, 1],
117
- });
118
- var color = fillStyle.getColor();
119
- expect(color.canvas).toMatchSnapshot();
120
- expect(color.id).toBe(3);
121
- expect(color.color).toEqual([235, 0, 0, 1]);
122
- expectWriteResult(feats, str);
123
- });
124
-
125
- test('should add zIndex and rotation to icon style and pictureOptions to feature properties.', function () {
126
- var str = "\n <kml " + xmlns + ">\n <Document>\n <name>lala</name>\n <Placemark>\n <description></description>\n <Style>\n <IconStyle>\n <scale>\n 2\n </scale>\n <heading>\n 1.5707963267948966\n </heading>\n <Icon>\n <href>https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>\n <gx:w>64</gx:w>\n <gx:h>64</gx:h>\n </Icon>\n <hotSpot x=\"20\" y=\"2\" xunits=\"pixels\" yunits=\"pixels\"/>\n </IconStyle>\n </Style>\n <ExtendedData>\n <Data name=\"iconRotation\">\n <value>1.5707963267948966</value>\n </Data>\n <Data name=\"maxZoom\">\n <value>18.5</value>\n </Data>\n <Data name=\"minZoom\">\n <value>15</value>\n </Data>\n <Data name=\"pictureOptions\">\n <value>{\"resolution\":4,\"defaultScale\":0.5}</value>\n </Data>\n <Data name=\"zIndex\">\n <value>1</value>\n </Data>\n </ExtendedData>\n <Point>\n <coordinates>0,0,0</coordinates>\n </Point>\n </Placemark>\n </Document>\n </kml>\n ";
127
- var feats = KML.readFeatures(str);
128
- var style = feats[0].getStyleFunction()(feats[0], 1);
129
- expect(style.getZIndex()).toBe(1);
130
- expect(style.getImage().getRotation()).toBe(1.5707963267948966);
131
- expect(feats[0].get('pictureOptions')).toEqual({
132
- resolution: 4,
133
- defaultScale: 0.5,
134
- });
135
- expect(feats[0].get('maxZoom')).toEqual(18.5);
136
- expect(feats[0].get('minZoom')).toEqual(15);
137
- expectWriteResult(feats, str);
138
- });
139
- });
140
-
141
- describe('writeDocumentCamera()', function () {
142
- var str = "\n <kml " + xmlns + ">\n <Document>\n <name>\n CamTest\n </name>\n </Document>\n </kml>";
143
-
144
- var strWithCam = "<kml " + xmlns + ">\n <Document>\n <name>\n CamTest\n </name>\n <Camera xmlns=\"\">\n <Heading>\n 270\n </Heading>\n <Altitude>\n 300\n </Altitude>\n <Longitude>\n 5.8\n </Longitude>\n <Latitude>\n 41.6\n </Latitude>\n </Camera>\n </Document>\n </kml>";
145
-
146
- test('should insert the correct <Camera> tag.', function () {
147
- var kmlWithKamera = KML.writeDocumentCamera(str, {
148
- heading: 270,
149
- altitude: 300,
150
- longitude: 5.8,
151
- latitude: 41.6,
152
- });
153
- expect(beautify(kmlWithKamera)).toEqual(beautify(strWithCam));
154
- });
155
-
156
- test('should remove the present <Camera> tag when called without cameraAttributes.', function () {
157
- var kmlWithoutKamera = KML.writeDocumentCamera(strWithCam);
158
- expect(beautify(kmlWithoutKamera)).toEqual(beautify(str));
159
- });
160
- });
161
- });
162
-
163
- //# sourceMappingURL=KML.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KML.test.js","sources":["../../src/utils/KML.test.js"],"sourcesContent":["import VectorLayer from 'ol/layer/Vector';\nimport VectorSource from 'ol/source/Vector';\nimport { Style } from 'ol/style';\nimport { get } from 'ol/proj';\nimport beautify from 'xml-beautifier';\nimport KML from './KML';\n\nconst xmlns =\n 'xmlns=\"http://www.opengis.net/kml/2.2\" xmlns:gx=\"http://www.google.com/kml/ext/2.2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd\"';\n\nconst expectWriteResult = (feats, str) => {\n expect(\n beautify(\n KML.writeFeatures(\n {\n name: 'lala',\n olLayer: new VectorLayer({\n source: new VectorSource({\n features: feats,\n }),\n }),\n },\n get('EPSG:4326'),\n ),\n ),\n ).toEqual(beautify(str));\n};\n\ndescribe('KML', () => {\n describe('readFeatures() and writeFeatures()', () => {\n test('should read/write LineStyle and ExtendedData (linesDash, lineStartIcon and lineEndIcon).', () => {\n const str = `\n <kml ${xmlns}>\n <Document>\n <name>lala</name>\n <Placemark>\n <Style>\n <LineStyle>\n <color>ff056600</color>\n <width>1</width>\n </LineStyle>\n </Style>\n <ExtendedData>\n <Data name=\"lineDash\"><value>40,40</value></Data>\n <Data name=\"lineEndIcon\"><value>{\"url\":\"fooarrowend.png\",\"scale\":0.35,\"size\":[36,58],\"zIndex\":1}</value></Data>\n <Data name=\"lineStartIcon\"><value>{\"url\":\"fooarrowstart.png\",\"scale\":0.35,\"size\":[36,58],\"zIndex\":1}</value></Data>\n </ExtendedData>\n <LineString><coordinates>0,1,0 3,5,0 40,25,0</coordinates></LineString>\n </Placemark>\n </Document>\n </kml>\n `;\n const feats = KML.readFeatures(str);\n const styles = feats[0].getStyle();\n expect(feats.length).toBe(1);\n expect(styles.length).toBe(3);\n\n // line stroke\n const strokeStyle = styles[0].getStroke();\n expect(strokeStyle.getColor()).toEqual([0, 102, 5, 1]);\n expect(strokeStyle.getLineDash()).toEqual([40, 40]);\n\n // line start icon\n const lineStartStyle = styles[1];\n expect(lineStartStyle.getImage().getRotation()).toEqual(\n -0.9272952180016122,\n );\n expect(lineStartStyle.getImage().getColor()).toEqual([0, 102, 5, 1]);\n expect(lineStartStyle.getImage().getRotateWithView()).toBe(true);\n expect(lineStartStyle.getGeometry()(feats[0]).getCoordinates()).toEqual([\n 0, 1, 0,\n ]);\n expect(lineStartStyle.getZIndex()).toEqual(1);\n\n // line end icon\n const lineEndStyle = styles[2];\n expect(lineEndStyle.getImage().getRotation()).toEqual(\n -0.49555167348582857,\n );\n expect(lineEndStyle.getImage().getRotateWithView()).toBe(true);\n expect(lineEndStyle.getImage().getColor()).toEqual([0, 102, 5, 1]);\n expect(lineEndStyle.getGeometry()(feats[0]).getCoordinates()).toEqual([\n 40, 25, 0,\n ]);\n expect(lineEndStyle.getZIndex()).toEqual(1);\n\n expectWriteResult(feats, str);\n });\n\n test('should read/write TextStyle and ExtendedData.', () => {\n const str = `\n <kml ${xmlns}>\n <Document>\n <name>lala</name>\n <Placemark>\n <name> bar </name>\n <Style>\n <IconStyle>\n <scale>0</scale>\n </IconStyle>\n <LabelStyle>\n <color>ff7e3420</color>\n <scale>2</scale>\n </LabelStyle>\n </Style>\n <ExtendedData>\n <Data name=\"textAlign\">\n <value>right</value>\n </Data>\n <Data name=\"textBackgroundFillColor\">\n <value>rgba(255,255,255,0.01)</value>\n </Data>\n <Data name=\"textFont\">\n <value>bold 16px arial</value>\n </Data>\n <Data name=\"textOffsetX\">\n <value>-90</value>\n </Data>\n <Data name=\"textOffsetY\">\n <value>30</value>\n </Data>\n <Data name=\"textPadding\">\n <value>5,6,7,8</value>\n </Data>\n <Data name=\"textRotation\">\n <value>2.303834612632515</value>\n </Data>\n <Data name=\"textStrokeColor\">\n <value>rgba(100,255,255,0.2)</value>\n </Data>\n <Data name=\"textStrokeWidth\">\n <value>3</value>\n </Data>\n </ExtendedData>\n <Point>\n <coordinates>0,0,0</coordinates>\n </Point>\n </Placemark>\n </Document>\n </kml>\n `;\n const feats = KML.readFeatures(str);\n const style = feats[0].getStyleFunction()(feats[0], 1);\n expect(feats.length).toBe(1);\n expect(style instanceof Style).toBe(true);\n\n // Text\n const styleText = style.getText();\n expect(styleText.getText()).toBe('bar'); // spaces are trimmed.\n expect(styleText.getFont()).toEqual('bold 16px arial');\n expect(styleText.getFill()).toEqual({ color_: [32, 52, 126, 1] });\n expect(styleText.getStroke()).toEqual({\n color_: 'rgba(100,255,255,0.2)',\n width_: 3,\n lineCap_: undefined,\n lineDashOffset_: undefined,\n lineDash_: null,\n lineJoin_: undefined,\n miterLimit_: undefined,\n });\n expect(styleText.getScale()).toEqual(2);\n expect(styleText.getRotation()).toEqual('2.303834612632515');\n expect(styleText.getPadding()).toEqual([5, 6, 7, 8]);\n expect(styleText.getBackgroundFill()).toEqual({\n color_: 'rgba(255,255,255,0.01)',\n });\n expect(styleText.getTextAlign()).toEqual('right');\n expect(styleText.getOffsetX()).toEqual(-90);\n expect(styleText.getOffsetY()).toEqual(30);\n expectWriteResult(feats, str);\n });\n\n test('should read and write lineDash and fillPattern style for polygon', () => {\n const str = `\n <kml ${xmlns}>\n <Document>\n <name>lala</name>\n <Placemark>\n <description></description>\n <Style>\n <LineStyle>\n <color>ff0000eb</color>\n <width>2</width>\n </LineStyle>\n <PolyStyle>\n <fill>0</fill>\n </PolyStyle>\n </Style>\n <ExtendedData>\n <Data name=\"fillPattern\">\n <value>{\"id\":3,\"color\":[235,0,0,1]}</value>\n </Data>\n <Data name=\"lineDash\">\n <value>1,1</value>\n </Data>\n </ExtendedData>\n <Polygon>\n <outerBoundaryIs>\n <LinearRing>\n <coordinates>8.521,47.381,0 8.529,47.375,0 8.531,47.382,0 8.521,47.381,0</coordinates>\n </LinearRing>\n </outerBoundaryIs>\n </Polygon>\n </Placemark>\n </Document>\n </kml>\n `;\n const feats = KML.readFeatures(str);\n const styles = feats[0].getStyle();\n expect(feats.length).toBe(1);\n expect(styles.length).toBe(1);\n\n // Polygon\n const feature = feats[0];\n const outlineStyle = styles[0].getStroke();\n expect(outlineStyle.getColor()).toEqual([235, 0, 0, 1]);\n expect(outlineStyle.getWidth()).toEqual(2);\n const fillStyle = styles[0].getFill();\n expect(feature.get('fillPattern')).toEqual({\n id: 3,\n color: [235, 0, 0, 1],\n });\n const color = fillStyle.getColor();\n expect(color.canvas).toMatchSnapshot();\n expect(color.id).toBe(3);\n expect(color.color).toEqual([235, 0, 0, 1]);\n expectWriteResult(feats, str);\n });\n\n test('should add zIndex and rotation to icon style and pictureOptions to feature properties.', () => {\n const str = `\n <kml ${xmlns}>\n <Document>\n <name>lala</name>\n <Placemark>\n <description></description>\n <Style>\n <IconStyle>\n <scale>\n 2\n </scale>\n <heading>\n 1.5707963267948966\n </heading>\n <Icon>\n <href>https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>\n <gx:w>64</gx:w>\n <gx:h>64</gx:h>\n </Icon>\n <hotSpot x=\"20\" y=\"2\" xunits=\"pixels\" yunits=\"pixels\"/>\n </IconStyle>\n </Style>\n <ExtendedData>\n <Data name=\"iconRotation\">\n <value>1.5707963267948966</value>\n </Data>\n <Data name=\"maxZoom\">\n <value>18.5</value>\n </Data>\n <Data name=\"minZoom\">\n <value>15</value>\n </Data>\n <Data name=\"pictureOptions\">\n <value>{\"resolution\":4,\"defaultScale\":0.5}</value>\n </Data>\n <Data name=\"zIndex\">\n <value>1</value>\n </Data>\n </ExtendedData>\n <Point>\n <coordinates>0,0,0</coordinates>\n </Point>\n </Placemark>\n </Document>\n </kml>\n `;\n const feats = KML.readFeatures(str);\n const style = feats[0].getStyleFunction()(feats[0], 1);\n expect(style.getZIndex()).toBe(1);\n expect(style.getImage().getRotation()).toBe(1.5707963267948966);\n expect(feats[0].get('pictureOptions')).toEqual({\n resolution: 4,\n defaultScale: 0.5,\n });\n expect(feats[0].get('maxZoom')).toEqual(18.5);\n expect(feats[0].get('minZoom')).toEqual(15);\n expectWriteResult(feats, str);\n });\n });\n\n describe('writeDocumentCamera()', () => {\n const str = `\n <kml ${xmlns}>\n <Document>\n <name>\n CamTest\n </name>\n </Document>\n </kml>`;\n\n const strWithCam = `<kml ${xmlns}>\n <Document>\n <name>\n CamTest\n </name>\n <Camera xmlns=\"\">\n <Heading>\n 270\n </Heading>\n <Altitude>\n 300\n </Altitude>\n <Longitude>\n 5.8\n </Longitude>\n <Latitude>\n 41.6\n </Latitude>\n </Camera>\n </Document>\n </kml>`;\n\n test('should insert the correct <Camera> tag.', () => {\n const kmlWithKamera = KML.writeDocumentCamera(str, {\n heading: 270,\n altitude: 300,\n longitude: 5.8,\n latitude: 41.6,\n });\n expect(beautify(kmlWithKamera)).toEqual(beautify(strWithCam));\n });\n\n test('should remove the present <Camera> tag when called without cameraAttributes.', () => {\n const kmlWithoutKamera = KML.writeDocumentCamera(strWithCam);\n expect(beautify(kmlWithoutKamera)).toEqual(beautify(str));\n });\n });\n});\n"],"names":["const"],"mappings":"AAAA,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,SAAS,KAAK,QAAQ,UAAU,CAAC;AACjC,SAAS,GAAG,QAAQ,SAAS,CAAC;AAC9B,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB;AACAA,GAAK,CAAC,KAAK;AACX,EAAE,oPAAoP,CAAC;AACvP;AACAA,GAAK,CAAC,iBAAiB,YAAG,CAAC,KAAK,EAAE,GAAG,EAAK;AAC1C,EAAE,MAAM;AACR,IAAI,QAAQ;AACZ,MAAM,GAAG,CAAC,aAAa;AACvB,QAAQ;AACR,UAAU,IAAI,EAAE,MAAM;AACtB,UAAU,OAAO,EAAE,IAAI,WAAW,CAAC;AACnC,YAAY,MAAM,EAAE,IAAI,YAAY,CAAC;AACrC,cAAc,QAAQ,EAAE,KAAK;AAC7B,aAAa,CAAC;AACd,WAAW,CAAC;AACZ,SAAS;AACT,QAAQ,GAAG,CAAC,WAAW,CAAE;AACzB,OAAQ;AACR,KAAM;AACN,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3B,CAAC,CAAC;AACF;AACA,QAAQ,CAAC,KAAK,WAAE,GAAM;AACtB,EAAE,QAAQ,CAAC,oCAAoC,WAAE,GAAM;AACvD,IAAI,IAAI,CAAC,0FAA0F,WAAE,GAAM;AAC3G,MAAMA,GAAK,CAAC,GAAG,GAAG,oBACH,KAAK,q2BAmBb,CAAC;AACR,MAAMA,GAAK,CAAC,KAAK,GAAG,GAAG,CAAC,YAAY,C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B,OAAO,CAAC,CAAC;AACT,MAAM,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;AACpE,KAAK,CAAC,CAAC;AACP;AACA,IAAI,IAAI,CAAC,8EAA8E,WAAE,GAAM;AAC/F,MAAMA,GAAK,CAAC,gBAAgB,GAAG,GAAG,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;AACnE,MAAM,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAChE,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;"}
@@ -1,22 +0,0 @@
1
- import KML from './KMLFormat';
2
-
3
- var xmlns =
4
- 'xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd"';
5
-
6
- describe('KML', function () {
7
- test('should read <Camera> tags correctly.', function () {
8
- var str = "\n <kml " + xmlns + ">\n <Document>\n <name>lala</name>\n <Camera>\n <Heading>\n 270\n </Heading>\n <Altitude>\n 300\n </Altitude>\n <Longitude>\n 5.8\n </Longitude>\n <Latitude>\n 41.6\n </Latitude>\n </Camera>\n <Placemark>\n <Camera>\n <Heading>\n 180\n </Heading>\n <AltitudeMode>\n clampToGround\n </AltitudeMode>\n </Camera>\n </Placemark>\n </Document>\n </kml>\n ";
9
- var format = new KML();
10
- var cameras = format.readCamera(str);
11
-
12
- expect(cameras.length).toEqual(2);
13
- expect(cameras[0].Heading).toEqual(270);
14
- expect(cameras[0].Altitude).toEqual(300);
15
- expect(cameras[0].Longitude).toEqual(5.8);
16
- expect(cameras[0].Latitude).toEqual(41.6);
17
- expect(cameras[1].Heading).toEqual(180);
18
- expect(cameras[1].AltitudeMode).toEqual('clampToGround');
19
- });
20
- });
21
-
22
- //# sourceMappingURL=KMLFormat.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KMLFormat.test.js","sources":["../../src/utils/KMLFormat.test.js"],"sourcesContent":["import KML from './KMLFormat';\n\nconst xmlns =\n 'xmlns=\"http://www.opengis.net/kml/2.2\" xmlns:gx=\"http://www.google.com/kml/ext/2.2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd\"';\n\ndescribe('KML', () => {\n test('should read <Camera> tags correctly.', () => {\n const str = `\n <kml ${xmlns}>\n <Document>\n <name>lala</name>\n <Camera>\n <Heading>\n 270\n </Heading>\n <Altitude>\n 300\n </Altitude>\n <Longitude>\n 5.8\n </Longitude>\n <Latitude>\n 41.6\n </Latitude>\n </Camera>\n <Placemark>\n <Camera>\n <Heading>\n 180\n </Heading>\n <AltitudeMode>\n clampToGround\n </AltitudeMode>\n </Camera>\n </Placemark>\n </Document>\n </kml>\n `;\n const format = new KML();\n const cameras = format.readCamera(str);\n\n expect(cameras.length).toEqual(2);\n expect(cameras[0].Heading).toEqual(270);\n expect(cameras[0].Altitude).toEqual(300);\n expect(cameras[0].Longitude).toEqual(5.8);\n expect(cameras[0].Latitude).toEqual(41.6);\n expect(cameras[1].Heading).toEqual(180);\n expect(cameras[1].AltitudeMode).toEqual('clampToGround');\n });\n});\n"],"names":["const"],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B;AACAA,GAAK,CAAC,KAAK;AACX,EAAE,oPAAoP,CAAC;AACvP;AACA,QAAQ,CAAC,KAAK,WAAE,GAAM;AACtB,EAAE,IAAI,CAAC,sCAAsC,WAAE,GAAM;AACrD,IAAIA,GAAK,CAAC,GAAG,GAAG,kBACH,KAAK,ouBA6Bb,CAAC;AACN,IAAIA,GAAK,CAAC,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;AAC7B,IAAIA,GAAK,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC3C;AACA,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACtC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC5C,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC7C,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC9C,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9C,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC5C,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAC7D,GAAG,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;"}
@@ -1,66 +0,0 @@
1
- import getPolygonPattern from './getPolygonPattern';
2
-
3
- describe('getPolygonPattern()', function () {
4
- test('render pattern with default properties (id=1, color = [235, 0, 0, 1])', function () {
5
- var color = [235, 0, 0, 1];
6
- var pattern = getPolygonPattern();
7
- expect(pattern).toEqual(color);
8
- expect(pattern.id).toBe();
9
- expect(pattern.color).toBe();
10
- expect(pattern.empty).toBe();
11
- expect(pattern.canvas).toBe();
12
- });
13
-
14
- test('render pattern 0 (no fill) color and (light blue) opacity', function () {
15
- var id = 0;
16
- var color = [0, 60, 80, 0.41000000000000003];
17
- var pattern = getPolygonPattern(id, [0, 60, 80, 0.41000000000000003]);
18
- expect(pattern.id).toBe(id);
19
- expect(pattern.color).toEqual(color);
20
- expect(pattern.empty).toBe(true);
21
- expect(pattern.canvas).toBe();
22
- });
23
-
24
- test('render pattern 1 (full by color) color and (light blue) opacity', function () {
25
- var id = 1;
26
- var color = [0, 60, 80, 0.41000000000000003];
27
- var pattern = getPolygonPattern(id, [0, 60, 80, 0.41000000000000003]);
28
- expect(pattern).toEqual(color);
29
- expect(pattern.id).toBe();
30
- expect(pattern.color).toBe();
31
- expect(pattern.empty).toBe();
32
- expect(pattern.canvas).toBe();
33
- });
34
-
35
- test('render pattern 2 (cross) color and (light blue) opacity', function () {
36
- var id = 2;
37
- var color = [0, 60, 80, 0.41000000000000003];
38
- var pattern = getPolygonPattern(id, [0, 60, 80, 0.41000000000000003]);
39
- expect(pattern.id).toBe(id);
40
- expect(pattern.color).toEqual(color);
41
- expect(pattern.empty).toBe();
42
- expect(pattern.canvas).toMatchSnapshot();
43
- });
44
-
45
- test('render pattern 3 (diagonal line from bottom-left tot top-right) with color (light blue) and opacity', function () {
46
- var id = 3;
47
- var color = [0, 60, 80, 0.41000000000000003];
48
- var pattern = getPolygonPattern(id, [0, 60, 80, 0.41000000000000003]);
49
- expect(pattern.id).toBe(id);
50
- expect(pattern.color).toEqual(color);
51
- expect(pattern.empty).toBe();
52
- expect(pattern.canvas).toMatchSnapshot();
53
- });
54
-
55
- test('render pattern 4 (diagonal line from top-left to bottom-right) with color (light blue) and opacity', function () {
56
- var id = 4;
57
- var color = [0, 60, 80, 0.41000000000000003];
58
- var pattern = getPolygonPattern(id, [0, 60, 80, 0.41000000000000003]);
59
- expect(pattern.id).toBe(id);
60
- expect(pattern.color).toEqual(color);
61
- expect(pattern.empty).toBe();
62
- expect(pattern.canvas).toMatchSnapshot();
63
- });
64
- });
65
-
66
- //# sourceMappingURL=getPolygonPattern.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getPolygonPattern.test.js","sources":["../../src/utils/getPolygonPattern.test.js"],"sourcesContent":["import getPolygonPattern from './getPolygonPattern';\n\ndescribe('getPolygonPattern()', () => {\n test('render pattern with default properties (id=1, color = [235, 0, 0, 1])', () => {\n const color = [235, 0, 0, 1];\n const pattern = getPolygonPattern();\n expect(pattern).toEqual(color);\n expect(pattern.id).toBe();\n expect(pattern.color).toBe();\n expect(pattern.empty).toBe();\n expect(pattern.canvas).toBe();\n });\n\n test('render pattern 0 (no fill) color and (light blue) opacity', () => {\n const id = 0;\n const color = [0, 60, 80, 0.41000000000000003];\n const pattern = getPolygonPattern(id, [0, 60, 80, 0.41000000000000003]);\n expect(pattern.id).toBe(id);\n expect(pattern.color).toEqual(color);\n expect(pattern.empty).toBe(true);\n expect(pattern.canvas).toBe();\n });\n\n test('render pattern 1 (full by color) color and (light blue) opacity', () => {\n const id = 1;\n const color = [0, 60, 80, 0.41000000000000003];\n const pattern = getPolygonPattern(id, [0, 60, 80, 0.41000000000000003]);\n expect(pattern).toEqual(color);\n expect(pattern.id).toBe();\n expect(pattern.color).toBe();\n expect(pattern.empty).toBe();\n expect(pattern.canvas).toBe();\n });\n\n test('render pattern 2 (cross) color and (light blue) opacity', () => {\n const id = 2;\n const color = [0, 60, 80, 0.41000000000000003];\n const pattern = getPolygonPattern(id, [0, 60, 80, 0.41000000000000003]);\n expect(pattern.id).toBe(id);\n expect(pattern.color).toEqual(color);\n expect(pattern.empty).toBe();\n expect(pattern.canvas).toMatchSnapshot();\n });\n\n test('render pattern 3 (diagonal line from bottom-left tot top-right) with color (light blue) and opacity', () => {\n const id = 3;\n const color = [0, 60, 80, 0.41000000000000003];\n const pattern = getPolygonPattern(id, [0, 60, 80, 0.41000000000000003]);\n expect(pattern.id).toBe(id);\n expect(pattern.color).toEqual(color);\n expect(pattern.empty).toBe();\n expect(pattern.canvas).toMatchSnapshot();\n });\n\n test('render pattern 4 (diagonal line from top-left to bottom-right) with color (light blue) and opacity', () => {\n const id = 4;\n const color = [0, 60, 80, 0.41000000000000003];\n const pattern = getPolygonPattern(id, [0, 60, 80, 0.41000000000000003]);\n expect(pattern.id).toBe(id);\n expect(pattern.color).toEqual(color);\n expect(pattern.empty).toBe();\n expect(pattern.canvas).toMatchSnapshot();\n });\n});\n"],"names":["const"],"mappings":"AAAA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD;AACA,QAAQ,CAAC,qBAAqB,WAAE,GAAM;AACtC,EAAE,IAAI,CAAC,uEAAuE,WAAE,GAAM;AACtF,IAAIA,GAAK,CAAC,KAAK,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACjC,IAAIA,GAAK,CAAC,OAAO,GAAG,iBAAiB,EAAE,CAAC;AACxC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACnC,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9B,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AAClC,GAAG,CAAC,CAAC;AACL;AACA,EAAE,IAAI,CAAC,2DAA2D,WAAE,GAAM;AAC1E,IAAIA,GAAK,CAAC,EAAE,GAAG,CAAC,CAAC;AACjB,IAAIA,GAAK,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAC;AACnD,IAAIA,GAAK,CAAC,OAAO,GAAG,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAC5E,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,C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IAAIA,GAAK,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAC;AACnD,IAAIA,GAAK,CAAC,OAAO,GAAG,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAC5E,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACzC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,CAAC;AAC7C,GAAG,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;"}
@@ -1,32 +0,0 @@
1
- import { getHoursAndMinutes, getDelayString } from './timeUtils';
2
-
3
- var RealDate = Date;
4
- describe('timeUtils', function () {
5
- beforeEach(function () {
6
- global.Date = jest.fn(function () {
7
- return {
8
- getHours: function () {
9
- return 0;
10
- },
11
- getMinutes: function () {
12
- return 2;
13
- },
14
- };
15
- });
16
- Object.assign(Date, RealDate);
17
- });
18
-
19
- afterEach(function () {
20
- global.Date = RealDate;
21
- });
22
-
23
- test('getHoursAndMinutes should be correct.', function () {
24
- expect(getHoursAndMinutes(123456)).toBe('00:02');
25
- });
26
-
27
- test('getDelayString should be correct.', function () {
28
- expect(getDelayString(123456)).toBe('2m3s');
29
- });
30
- });
31
-
32
- //# sourceMappingURL=timeUtils.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeUtils.test.js","sources":["../../src/utils/timeUtils.test.js"],"sourcesContent":["import { getHoursAndMinutes, getDelayString } from './timeUtils';\n\nconst RealDate = Date;\ndescribe('timeUtils', () => {\n beforeEach(() => {\n global.Date = jest.fn(() => {\n return {\n getHours: () => {\n return 0;\n },\n getMinutes: () => {\n return 2;\n },\n };\n });\n Object.assign(Date, RealDate);\n });\n\n afterEach(() => {\n global.Date = RealDate;\n });\n\n test('getHoursAndMinutes should be correct.', () => {\n expect(getHoursAndMinutes(123456)).toBe('00:02');\n });\n\n test('getDelayString should be correct.', () => {\n expect(getDelayString(123456)).toBe('2m3s');\n });\n});\n"],"names":["const"],"mappings":"AAAA,SAAS,kBAAkB,EAAE,cAAc,QAAQ,aAAa,CAAC;AACjE;AACAA,GAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;AACtB,QAAQ,CAAC,WAAW,WAAE,GAAM;AAC5B,EAAE,UAAU,UAAC,GAAM;AACnB,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,UAAC,GAAM;AAChC,MAAM,OAAO;AACb,QAAQ,QAAQ,WAAE,GAAM;AACxB,UAAU,OAAO,CAAC,CAAC;AACnB,SAAS;AACT,QAAQ,UAAU,WAAE,GAAM;AAC1B,UAAU,OAAO,CAAC,CAAC;AACnB,SAAS;AACT,OAAO,CAAC;AACR,KAAK,CAAC,CAAC;AACP,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAClC,GAAG,CAAC,CAAC;AACL;AACA,EAAE,SAAS,UAAC,GAAM;AAClB,IAAI,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;AAC3B,GAAG,CAAC,CAAC;AACL;AACA,EAAE,IAAI,CAAC,uCAAuC,WAAE,GAAM;AACtD,IAAI,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACrD,GAAG,CAAC,CAAC;AACL;AACA,EAAE,IAAI,CAAC,mCAAmC,WAAE,GAAM;AAClD,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAChD,GAAG,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;"}