Skip to content

Commit 1a69791

Browse files
tests(e2e): provide tests for controls (#314)
* test(e2e): await map.goto * refactor(demos): remove rotation where not needed * tests(e2e): provide tests for controls * test(e2e): update screenshot for controlbar
1 parent aef8922 commit 1a69791

File tree

81 files changed

+283
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+283
-163
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ components/*.d.ts
3333
/test-results/
3434
/playwright-report/
3535
/playwright/.cache/
36+
tests/downloads

src/demos/AttributionControlDemo.vue

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ol-view
44
ref="view"
55
:center="center"
6-
:rotation="rotation"
76
:zoom="zoom"
87
:projection="projection"
98
/>

src/demos/BingMapsDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<ol-view
1313
ref="view"
1414
:center="center"
15-
:rotation="rotation"
1615
:zoom="zoom"
1716
:projection="projection"
1817
/>
@@ -32,6 +31,5 @@ import { ref } from "vue";
3231
const center = ref([40, 40]);
3332
const projection = ref("EPSG:4326");
3433
const zoom = ref(8);
35-
const rotation = ref(0);
3634
const selected = ref("AerialWithLabels");
3735
</script>

src/demos/CircleDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ol-view
88
ref="view"
99
:center="center"
10-
:rotation="rotation"
1110
:zoom="zoom"
1211
:projection="projection"
1312
/>
@@ -36,5 +35,4 @@ import { ref } from "vue";
3635
const center = ref([30, 40]);
3736
const projection = ref("EPSG:4326");
3837
const zoom = ref(10);
39-
const rotation = ref(0);
4038
</script>

src/demos/ClusterDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<ol-view
99
ref="view"
1010
:center="center"
11-
:rotation="rotation"
1211
:zoom="zoom"
1312
:projection="projection"
1413
/>
@@ -51,7 +50,6 @@ import { arrayWith500Points } from "./points";
5150
const center = ref([34, 39.13]);
5251
const projection = ref("EPSG:4326");
5352
const zoom = ref(6.8);
54-
const rotation = ref(0);
5553
5654
const overrideStyleFunction = (feature, style, resolution) => {
5755
console.log({ feature, style, resolution });

src/demos/ContextMenuDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
>
99
<ol-view
1010
:center="center"
11-
:rotation="rotation"
1211
:zoom="zoom"
1312
:projection="projection"
1413
ref="view"
@@ -37,7 +36,6 @@ import marker from "@/assets/marker.png";
3736
const center = ref([40, 40]);
3837
const projection = ref("EPSG:4326");
3938
const zoom = ref(8);
40-
const rotation = ref(0);
4139
4240
const contextMenuItems = ref([]);
4341

src/demos/ControlBarDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<ol-view
1010
ref="view"
1111
:center="center"
12-
:rotation="rotation"
1312
:zoom="zoom"
1413
:projection="projection"
1514
/>
@@ -61,7 +60,6 @@ import { ref } from "vue";
6160
const center = ref([34, 39.13]);
6261
const projection = ref("EPSG:4326");
6362
const zoom = ref(6);
64-
const rotation = ref(0);
6563
const view = ref(null);
6664
6765
const drawEnable = ref(false);

src/demos/DrawDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<ol-view
2424
ref="view"
2525
:center="center"
26-
:rotation="rotation"
2726
:zoom="zoom"
2827
:projection="projection"
2928
/>
@@ -64,7 +63,6 @@ import { ref } from "vue";
6463
const center = ref([40, 40]);
6564
const projection = ref("EPSG:4326");
6665
const zoom = ref(8);
67-
const rotation = ref(0);
6866
6967
const drawEnable = ref(true);
7068
const drawType = ref("Polygon");

src/demos/DropAnimation.vue

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ol-view
88
ref="view"
99
:center="center"
10-
:rotation="rotation"
1110
:zoom="zoom"
1211
:projection="projection"
1312
/>
@@ -45,5 +44,4 @@ import { arrayWith500Points } from "./points";
4544
const center = ref([40, 40]);
4645
const projection = ref("EPSG:4326");
4746
const zoom = ref(6);
48-
const rotation = ref(0);
4947
</script>

src/demos/FadeAnimation.vue

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ol-view
88
ref="view"
99
:center="center"
10-
:rotation="rotation"
1110
:zoom="zoom"
1211
:projection="projection"
1312
/>
@@ -45,5 +44,4 @@ import { arrayWith500Points } from "./points";
4544
const center = ref([40, 40]);
4645
const projection = ref("EPSG:4326");
4746
const zoom = ref(6);
48-
const rotation = ref(0);
4947
</script>

src/demos/FeatureSelectDemo.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@click="selectFeature"
1313
ref="mapRef"
1414
>
15-
<ol-view ref="view" :center="center" :rotation="rotation" :zoom="zoom" />
15+
<ol-view ref="view" :center="center" :zoom="zoom" />
1616

1717
<ol-vector-tile-layer class-name="feature-layer">
1818
<ol-source-vector-tile :url="url" :format="mvtFormat" />
@@ -69,7 +69,6 @@ const mvtFormat = new format.MVT({ featureClass: Feature });
6969
const mapRef = ref<{ map: MapRef } | null>(null);
7070
const center = ref([943955.9456952971, 6356667.343082143]);
7171
const zoom = ref(18);
72-
const rotation = ref(0);
7372
const url = ref(
7473
"https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/tile/{z}/{y}/{x}.pbf",
7574
);

src/demos/FullscreenControlDemo.vue

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ol-view
44
ref="view"
55
:center="center"
6-
:rotation="rotation"
76
:zoom="zoom"
87
:projection="projection"
98
/>

src/demos/GeoLocationDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<ol-view
99
ref="view"
1010
:center="center"
11-
:rotation="rotation"
1211
:zoom="zoom"
1312
:projection="projection"
1413
/>
@@ -43,7 +42,6 @@ import type { ObjectEvent } from "ol/Object";
4342
const center = ref([40, 40]);
4443
const projection = ref("EPSG:4326");
4544
const zoom = ref(12);
46-
const rotation = ref(0);
4745
const view = ref<View>();
4846
const map = ref(null);
4947
const position = ref([]);

src/demos/GeomPoint.vue

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<ol-view
1111
ref="view"
1212
:center="center"
13-
:rotation="rotation"
1413
:zoom="zoom"
1514
:projection="projection"
1615
/>
@@ -44,7 +43,6 @@ import { ref } from "vue";
4443
const center = ref([40, 40]);
4544
const projection = ref("EPSG:4326");
4645
const zoom = ref(8);
47-
const rotation = ref(0);
4846
const radius = ref(40);
4947
const strokeWidth = ref(10);
5048
const strokeColor = ref("red");

src/demos/HeatmapLayerDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<ol-view
99
ref="view"
1010
:center="center"
11-
:rotation="rotation"
1211
:zoom="zoom"
1312
:projection="projection"
1413
/>
@@ -40,7 +39,6 @@ import { ref, inject } from "vue";
4039
const center = ref([101.97, 4.21]);
4140
const projection = ref("EPSG:4326");
4241
const zoom = ref(5);
43-
const rotation = ref(0);
4442
const format = inject("ol-format");
4543
const kml = new format.KML({ extractStyles: false });
4644
const heatmapWeight = function (feature) {

src/demos/IconDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<ol-view
99
ref="view"
1010
:center="center"
11-
:rotation="rotation"
1211
:zoom="zoom"
1312
:projection="projection"
1413
/>
@@ -41,7 +40,6 @@ import markerIcon from "@/assets/marker.png";
4140
const center = ref([34, 39.13]);
4241
const projection = ref("EPSG:4326");
4342
const zoom = ref(6.8);
44-
const rotation = ref(0);
4543
const format = inject("ol-format");
4644
const geoJson = new format.GeoJSON();
4745
</script>

src/demos/ImageLayerDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ol-view
88
ref="view"
99
:center="center"
10-
:rotation="rotation"
1110
:zoom="zoom"
1211
:projection="projection"
1312
/>
@@ -29,7 +28,6 @@
2928
import { ref, reactive } from "vue";
3029
3130
const zoom = ref(2);
32-
const rotation = ref(0);
3331
const size = ref([1024, 968]);
3432
const center = ref([size.value[0] / 2, size.value[1] / 2]);
3533
const extent = ref([0, 0, ...size.value]);

src/demos/ImageWMSDemo.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:loadTilesWhileInteracting="true"
55
style="height: 400px"
66
>
7-
<ol-view ref="view" :center="center" :rotation="rotation" :zoom="zoom" />
7+
<ol-view ref="view" :center="center" :zoom="zoom" />
88
<ol-zoom-control />
99

1010
<ol-tile-layer :zIndex="1000">
@@ -26,6 +26,5 @@
2626
import { ref } from "vue";
2727
2828
const zoom = ref(4);
29-
const rotation = ref(0);
3029
const center = ref([-10997148, 4569099]);
3130
</script>

src/demos/LayerswitcherControlDemo.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ol-view
44
ref="view"
55
:center="center"
6-
:rotation="rotation"
76
:zoom="zoom"
87
:projection="projection"
98
/>
@@ -18,7 +17,7 @@
1817
<ol-tile-layer ref="bingLayer" title="Bing Maps">
1918
<ol-source-bingmaps
2019
apiKey="AjtUzWJBHlI3Ma_Ke6Qv2fGRXEs0ua5hUQi54ECwfXTiWsitll4AkETZDihjcfeI"
21-
:imagerySet="'CanvasDark'"
20+
imagerySet="CanvasDark"
2221
/>
2322
</ol-tile-layer>
2423

src/demos/LayerswitcherimageControlDemo.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ol-view
44
ref="view"
55
:center="center"
6-
:rotation="rotation"
76
:zoom="zoom"
87
:projection="projection"
98
/>
@@ -18,7 +17,7 @@
1817
<ol-tile-layer ref="bingLayer" title="Bing Maps">
1918
<ol-source-bingmaps
2019
apiKey="AjtUzWJBHlI3Ma_Ke6Qv2fGRXEs0ua5hUQi54ECwfXTiWsitll4AkETZDihjcfeI"
21-
:imagerySet="'CanvasDark'"
20+
imagerySet="RoadOnDemand"
2221
/>
2322
</ol-tile-layer>
2423

src/demos/LineString.vue

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ol-view
88
ref="view"
99
:center="center"
10-
:rotation="rotation"
1110
:zoom="zoom"
1211
:projection="projection"
1312
/>
@@ -57,7 +56,6 @@ import { ref } from "vue";
5756
const center = ref([116.54875, 40.45064]);
5857
const projection = ref("EPSG:4326");
5958
const zoom = ref(17);
60-
const rotation = ref(0);
6159
const strokeWidth = ref(10);
6260
const strokeColor = ref("red");
6361
</script>

src/demos/MapDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ol-view
88
ref="view"
99
:center="center"
10-
:rotation="rotation"
1110
:zoom="zoom"
1211
:projection="projection"
1312
/>
@@ -24,5 +23,4 @@ import { ref } from "vue";
2423
const center = ref([40, 40]);
2524
const projection = ref("EPSG:4326");
2625
const zoom = ref(8);
27-
const rotation = ref(0);
2826
</script>

src/demos/MousepositionControlDemo.vue

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ol-view
44
ref="view"
55
:center="center"
6-
:rotation="rotation"
76
:zoom="zoom"
87
:projection="projection"
98
/>

src/demos/MultiLineString.vue

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ol-view
88
ref="view"
99
:center="center"
10-
:rotation="rotation"
1110
:zoom="zoom"
1211
:projection="projection"
1312
/>
@@ -60,7 +59,6 @@ import { ref } from "vue";
6059
const center = ref([116.54875, 40.45064]);
6160
const projection = ref("EPSG:4326");
6261
const zoom = ref(17);
63-
const rotation = ref(0);
6462
const strokeWidth = ref(10);
6563
const strokeColor = ref("red");
6664
</script>

src/demos/MultiPoint.vue

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ol-view
88
ref="view"
99
:center="center"
10-
:rotation="rotation"
1110
:zoom="zoom"
1211
:projection="projection"
1312
/>
@@ -60,7 +59,6 @@ import { ref } from "vue";
6059
const center = ref([116.54875, 40.45064]);
6160
const projection = ref("EPSG:4326");
6261
const zoom = ref(17);
63-
const rotation = ref(0);
6462
const radius = ref(10);
6563
const strokeWidth = ref(4);
6664
const strokeColor = ref("red");

src/demos/MultiPolygon.vue

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ol-view
88
ref="view"
99
:center="center"
10-
:rotation="rotation"
1110
:zoom="zoom"
1211
:projection="projection"
1312
/>
@@ -59,7 +58,6 @@ import { ref } from "vue";
5958
const center = ref([-98.8449, 19.6869]);
6059
const projection = ref("EPSG:4326");
6160
const zoom = ref(15);
62-
const rotation = ref(0);
6361
const strokeWidth = ref(10);
6462
const strokeColor = ref("red");
6563
</script>

src/demos/PolygonDemo.vue

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ol-view
88
ref="view"
99
:center="center"
10-
:rotation="rotation"
1110
:zoom="zoom"
1211
:projection="projection"
1312
/>
@@ -53,5 +52,4 @@ import { ref } from "vue";
5352
const center = ref([-98.8449, 19.6869]);
5453
const projection = ref("EPSG:4326");
5554
const zoom = ref(15);
56-
const rotation = ref(0);
5755
</script>

src/demos/PrintdialogControlDemo.vue

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ol-view
44
ref="view"
55
:center="center"
6-
:rotation="rotation"
76
:zoom="zoom"
87
:projection="projection"
98
/>

0 commit comments

Comments
 (0)