Skip to content

Commit 2e80f91

Browse files
chore: Improve map dimensions in test app
1 parent 8a5c22f commit 2e80f91

File tree

8 files changed

+20
-57
lines changed

8 files changed

+20
-57
lines changed

plugin/e2e-tests/src/pages/Drawing/Circles.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const CircleMapPage: React.FC = () => {
180180
bottom: 0,
181181
left: 0,
182182
width: window.outerWidth,
183-
height: 500,
183+
height: window.outerWidth * 2 / 3,
184184
}}
185185
></capacitor-google-map>
186186
</BaseTestingPage>

plugin/e2e-tests/src/pages/Drawing/Polygons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const PolygonMapPage: React.FC = () => {
205205
bottom: 0,
206206
left: 0,
207207
width: window.outerWidth,
208-
height: 500,
208+
height: window.outerWidth * 2 / 3,
209209
}}
210210
></capacitor-google-map>
211211
</BaseTestingPage>

plugin/e2e-tests/src/pages/Drawing/Polylines.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const PolylineMapPage: React.FC = () => {
2222
setCommandOutput('');
2323
setMap(null);
2424
try {
25-
const mapRef = document.getElementById('map')!;
25+
const mapRef = document.getElementById('map_polylines')!;
2626

2727
const newMap = await GoogleMap.create({
2828
element: mapRef,
@@ -162,7 +162,7 @@ const PolylineMapPage: React.FC = () => {
162162
bottom: 0,
163163
left: 0,
164164
width: window.outerWidth,
165-
height: 500,
165+
height: window.outerWidth * 2 / 3,
166166
}}
167167
></capacitor-google-map>
168168
</BaseTestingPage>

plugin/e2e-tests/src/pages/Map/Bounds.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,16 @@ const BoundsMapPage: React.FC = () => {
122122
return (
123123
<BaseTestingPage pageTitle="Bounds">
124124
<div>
125-
<IonButton expand="block" id="createMapButton" onClick={createMap}>
125+
<IonButton id="createMapButton" onClick={createMap}>
126126
Create Map
127127
</IonButton>
128-
<IonButton expand="block" id="destroyMapButton" onClick={destroyMap}>
128+
<IonButton id="destroyMapButton" onClick={destroyMap}>
129129
Destroy Map
130130
</IonButton>
131-
<IonButton expand="block" id="getBoundsButton" onClick={getBounds}>
131+
<IonButton id="getBoundsButton" onClick={getBounds}>
132132
Get Bounds
133133
</IonButton>
134-
<IonButton expand="block" id="fitBoundsButton" onClick={fitBounds}>
134+
<IonButton id="fitBoundsButton" onClick={fitBounds}>
135135
Fit Bounds
136136
</IonButton>
137137
<IonRow>
@@ -185,7 +185,7 @@ const BoundsMapPage: React.FC = () => {
185185
top: window.innerHeight - window.outerWidth / 2,
186186
left: 0,
187187
width: window.outerWidth,
188-
height: window.outerWidth,
188+
height: window.outerWidth / 2,
189189
}}
190190
></capacitor-google-map>
191191
</BaseTestingPage>

plugin/e2e-tests/src/pages/Map/ConfigMap.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@ const ConfigMapPage: React.FC = () => {
227227
return (
228228
<BaseTestingPage pageTitle="Map Configuration">
229229
<div>
230-
<IonButton expand="block" id="createMapButton" onClick={createMaps}>
230+
<IonButton id="createMapButton" onClick={createMaps}>
231231
Create Maps
232232
</IonButton>
233-
<IonButton expand="block" id="destroyMapButton" onClick={destroyMaps}>
233+
<IonButton id="destroyMapButton" onClick={destroyMaps}>
234234
Destroy Maps
235235
</IonButton>
236236
<IonButton id="moveCameraButton" onClick={moveCameras}>Move Camera</IonButton>

plugin/e2e-tests/src/pages/Map/CreateAndDestroyMap.tsx

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,6 @@ const CreateAndDestroyMapPage: React.FC = () => {
8686
}
8787
}
8888

89-
async function setOnMapBoundsChangedListeners() {
90-
setCommandOutput('');
91-
try {
92-
if (maps) {
93-
for (let map of maps) {
94-
map.setOnBoundsChangedListener(onMapBoundsChanged);
95-
}
96-
setCommandOutput('Map Bounds Changed Listeners Set');
97-
}
98-
} catch (err: any) {
99-
setCommandOutput(err.message);
100-
}
101-
}
102-
10389
async function removeOnMapClickListeners() {
10490
setCommandOutput('');
10591
try {
@@ -158,16 +144,6 @@ const CreateAndDestroyMapPage: React.FC = () => {
158144
}
159145
}
160146

161-
async function getBounds() {
162-
setCommandOutput('');
163-
try {
164-
const bounds = await maps[0].getMapBounds();
165-
setCommandOutput(JSON.stringify(bounds));
166-
} catch (err: any) {
167-
setCommandOutput(err.message);
168-
}
169-
}
170-
171147
return (
172148
<BaseTestingPage pageTitle="Create and Destroy Map">
173149
<div>
@@ -181,16 +157,6 @@ const CreateAndDestroyMapPage: React.FC = () => {
181157
>
182158
Set On Map Click Listeners
183159
</IonButton>
184-
<IonButton
185-
expand="block"
186-
id="setOnMapBoundsButton"
187-
onClick={setOnMapBoundsChangedListeners}
188-
>
189-
Set On Map Bounds Changed Listeners
190-
</IonButton>
191-
<IonButton expand="block" id="getMapBounds" onClick={getBounds}>
192-
Get Current Bounds
193-
</IonButton>
194160
<IonButton
195161
expand="block"
196162
id="removeOnMapClickButton"

plugin/e2e-tests/src/pages/Markers/AddAndRemoveMarkers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ const AddAndRemoveMarkers: React.FC = () => {
152152
</div>
153153
<capacitor-google-map id="markers_add_remove_map1" style={{
154154
position: "absolute",
155-
top: window.innerHeight - 300,
155+
top: window.innerHeight - 150,
156156
left: 0,
157157
width: window.innerWidth,
158-
height: 300,
158+
height: window.outerWidth / 2,
159159
}}></capacitor-google-map>
160160
</BaseTestingPage>
161161
)

plugin/e2e-tests/src/pages/Markers/MarkerCustomizations.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -332,40 +332,37 @@ const MarkerCustomizations: React.FC = () => {
332332
return (
333333
<BaseTestingPage pageTitle="Marker Customization">
334334
<div>
335-
<IonButton id="createMapButton" onClick={createMap} expand="block">
335+
<IonButton id="createMapButton" onClick={createMap}>
336336
Create Map
337337
</IonButton>
338-
<IonButton id="addMarkerImageButton" onClick={addMarkerImage} expand="block">
338+
<IonButton id="addMarkerImageButton" onClick={addMarkerImage}>
339339
Add Marker with Image
340340
</IonButton>
341-
<IonButton id="addMarkerSVGButton" onClick={addMarkerSVG} expand="block">
341+
<IonButton id="addMarkerSVGButton" onClick={addMarkerSVG}>
342342
Add Marker with SVG
343343
</IonButton>
344-
<IonButton id="addMarkerColorButton" onClick={addMarkerColor} expand="block">
344+
<IonButton id="addMarkerColorButton" onClick={addMarkerColor}>
345345
Add Marker with Color
346346
</IonButton>
347347
<IonButton
348348
id="addMultipleImageMarkersButton"
349349
onClick={addMultipleImageMarkers}
350-
expand="block"
351350
>
352351
Add Multiple Image Markers
353352
</IonButton>
354353
<IonButton
355354
id="addMultipleColorMarkersButton"
356355
onClick={addMultipleColorMarkers}
357-
expand="block"
358356
>
359357
Add Multiple Color Markers
360358
</IonButton>
361359
<IonButton
362360
id="removeAllMarkersButton"
363-
expand="block"
364361
onClick={removeAllMarkers}
365362
>
366363
Remove All Markers
367364
</IonButton>
368-
<IonButton id="destroyMapButton" expand="block" onClick={destroyMap}>
365+
<IonButton id="destroyMapButton" onClick={destroyMap}>
369366
Destroy Map
370367
</IonButton>
371368
</div>
@@ -376,10 +373,10 @@ const MarkerCustomizations: React.FC = () => {
376373
id="map_marker_custom"
377374
style={{
378375
position: 'absolute',
379-
top: window.innerHeight - 250,
376+
top: window.innerHeight - 150,
380377
left: 0,
381378
width: window.innerWidth,
382-
height: 250,
379+
height: 200,
383380
}}
384381
></capacitor-google-map>
385382
</BaseTestingPage>

0 commit comments

Comments
 (0)