Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions plugin/e2e-tests/src/pages/Drawing/Circles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const CircleMapPage: React.FC = () => {
setCommandOutput('');
setMap(null);
try {
const mapRef = document.getElementById('map')!;
const mapRef = document.getElementById('map_circles')!;

const newMap = await GoogleMap.create({
element: mapRef,
id: 'test-map',
id: 'test-map-circles',
apiKey: apiKey!,
config: {
center: { lat: 37.09, lng: -95.712 },
Expand Down Expand Up @@ -174,13 +174,13 @@ const CircleMapPage: React.FC = () => {
></IonTextarea>
</div>
<capacitor-google-map
id="map"
id="map_circles"
style={{
position: 'absolute',
bottom: 0,
left: 0,
width: window.outerWidth,
height: 500,
height: window.outerWidth * 2 / 3,
}}
></capacitor-google-map>
</BaseTestingPage>
Expand Down
8 changes: 4 additions & 4 deletions plugin/e2e-tests/src/pages/Drawing/Polygons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const PolygonMapPage: React.FC = () => {
setCommandOutput('');
setMap(null);
try {
const mapRef = document.getElementById('map')!;
const mapRef = document.getElementById('map_polygons')!;

const newMap = await GoogleMap.create({
element: mapRef,
id: 'test-map',
id: 'test-map-polygons',
apiKey: apiKey!,
config: {
center: {
Expand Down Expand Up @@ -199,13 +199,13 @@ const PolygonMapPage: React.FC = () => {
></IonTextarea>
</div>
<capacitor-google-map
id="map"
id="map_polygons"
style={{
position: 'absolute',
bottom: 0,
left: 0,
width: window.outerWidth,
height: 500,
height: window.outerWidth * 2 / 3,
}}
></capacitor-google-map>
</BaseTestingPage>
Expand Down
8 changes: 4 additions & 4 deletions plugin/e2e-tests/src/pages/Drawing/Polylines.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const PolylineMapPage: React.FC = () => {
setCommandOutput('');
setMap(null);
try {
const mapRef = document.getElementById('map')!;
const mapRef = document.getElementById('map_polylines')!;

const newMap = await GoogleMap.create({
element: mapRef,
id: 'test-map',
id: 'test-map-polylines',
apiKey: apiKey!,
config: {
center: {
Expand Down Expand Up @@ -156,13 +156,13 @@ const PolylineMapPage: React.FC = () => {
></IonTextarea>
</div>
<capacitor-google-map
id="map"
id="map_polylines"
style={{
position: 'absolute',
bottom: 0,
left: 0,
width: window.outerWidth,
height: 500,
height: window.outerWidth * 2 / 3,
}}
></capacitor-google-map>
</BaseTestingPage>
Expand Down
16 changes: 8 additions & 8 deletions plugin/e2e-tests/src/pages/Map/Bounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const BoundsMapPage: React.FC = () => {
setCommandOutput('');
setMap(null);
try {
const mapRef = document.getElementById('map')!;
const mapRef = document.getElementById('map_bounds')!;

const newMap = await GoogleMap.create({
element: mapRef,
id: 'test-map',
id: 'test-map-bounds',
apiKey: apiKey!,
config: {
center: {
Expand Down Expand Up @@ -122,16 +122,16 @@ const BoundsMapPage: React.FC = () => {
return (
<BaseTestingPage pageTitle="Bounds">
<div>
<IonButton expand="block" id="createMapButton" onClick={createMap}>
<IonButton id="createMapButton" onClick={createMap}>
Create Map
</IonButton>
<IonButton expand="block" id="destroyMapButton" onClick={destroyMap}>
<IonButton id="destroyMapButton" onClick={destroyMap}>
Destroy Map
</IonButton>
<IonButton expand="block" id="getBoundsButton" onClick={getBounds}>
<IonButton id="getBoundsButton" onClick={getBounds}>
Get Bounds
</IonButton>
<IonButton expand="block" id="fitBoundsButton" onClick={fitBounds}>
<IonButton id="fitBoundsButton" onClick={fitBounds}>
Fit Bounds
</IonButton>
<IonRow>
Expand Down Expand Up @@ -179,13 +179,13 @@ const BoundsMapPage: React.FC = () => {
></IonTextarea>
</div>
<capacitor-google-map
id="map"
id="map_bounds"
style={{
position: 'absolute',
top: window.innerHeight - window.outerWidth / 2,
left: 0,
width: window.outerWidth,
height: window.outerWidth,
height: window.outerWidth / 2,
}}
></capacitor-google-map>
</BaseTestingPage>
Expand Down
8 changes: 4 additions & 4 deletions plugin/e2e-tests/src/pages/Map/ConfigMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ConfigMapPage: React.FC = () => {

const newMap1 = await GoogleMap.create({
element: mapRef1,
id: "test-map",
id: "test-map-config1",
apiKey: apiKey!,
config: {
center: {
Expand All @@ -32,7 +32,7 @@ const ConfigMapPage: React.FC = () => {

const newMap2 = await GoogleMap.create({
element: mapRef2,
id: "test-map2",
id: "test-map-config2",
apiKey: apiKey!,
config: {
center: {
Expand Down Expand Up @@ -227,10 +227,10 @@ const ConfigMapPage: React.FC = () => {
return (
<BaseTestingPage pageTitle="Map Configuration">
<div>
<IonButton expand="block" id="createMapButton" onClick={createMaps}>
<IonButton id="createMapButton" onClick={createMaps}>
Create Maps
</IonButton>
<IonButton expand="block" id="destroyMapButton" onClick={destroyMaps}>
<IonButton id="destroyMapButton" onClick={destroyMaps}>
Destroy Maps
</IonButton>
<IonButton id="moveCameraButton" onClick={moveCameras}>Move Camera</IonButton>
Expand Down
46 changes: 6 additions & 40 deletions plugin/e2e-tests/src/pages/Map/CreateAndDestroyMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ const CreateAndDestroyMapPage: React.FC = () => {
setCommandOutput('');
setMaps([]);
try {
const mapRef1 = document.getElementById('map1')!;
const mapRef2 = document.getElementById('map2')!;
const mapRef1 = document.getElementById('map1_create_destroy')!;
const mapRef2 = document.getElementById('map2_create_destroy')!;

const newMap1 = await GoogleMap.create(
{
element: mapRef1,
id: 'test-map',
id: 'test-map-create-destroy1',
apiKey: apiKey!,
config: {
center: {
Expand All @@ -51,7 +51,7 @@ const CreateAndDestroyMapPage: React.FC = () => {
const newMap2 = await GoogleMap.create(
{
element: mapRef2,
id: 'test-map2',
id: 'test-map-create-destroy2',
apiKey: apiKey!,
config: {
center: {
Expand Down Expand Up @@ -86,20 +86,6 @@ const CreateAndDestroyMapPage: React.FC = () => {
}
}

async function setOnMapBoundsChangedListeners() {
setCommandOutput('');
try {
if (maps) {
for (let map of maps) {
map.setOnBoundsChangedListener(onMapBoundsChanged);
}
setCommandOutput('Map Bounds Changed Listeners Set');
}
} catch (err: any) {
setCommandOutput(err.message);
}
}

async function removeOnMapClickListeners() {
setCommandOutput('');
try {
Expand Down Expand Up @@ -158,16 +144,6 @@ const CreateAndDestroyMapPage: React.FC = () => {
}
}

async function getBounds() {
setCommandOutput('');
try {
const bounds = await maps[0].getMapBounds();
setCommandOutput(JSON.stringify(bounds));
} catch (err: any) {
setCommandOutput(err.message);
}
}

return (
<BaseTestingPage pageTitle="Create and Destroy Map">
<div>
Expand All @@ -181,16 +157,6 @@ const CreateAndDestroyMapPage: React.FC = () => {
>
Set On Map Click Listeners
</IonButton>
<IonButton
expand="block"
id="setOnMapBoundsButton"
onClick={setOnMapBoundsChangedListeners}
>
Set On Map Bounds Changed Listeners
</IonButton>
<IonButton expand="block" id="getMapBounds" onClick={getBounds}>
Get Current Bounds
</IonButton>
<IonButton
expand="block"
id="removeOnMapClickButton"
Expand All @@ -212,7 +178,7 @@ const CreateAndDestroyMapPage: React.FC = () => {
<IonTextarea id="commandOutput" value={commandOutput}></IonTextarea>
</div>
<capacitor-google-map
id="map1"
id="map1_create_destroy"
style={{
position: 'absolute',
top: window.innerHeight - window.outerWidth / 2,
Expand All @@ -222,7 +188,7 @@ const CreateAndDestroyMapPage: React.FC = () => {
}}
></capacitor-google-map>
<capacitor-google-map
id="map2"
id="map2_create_destroy"
style={{
position: 'absolute',
top: window.innerHeight - window.outerWidth / 2,
Expand Down
12 changes: 6 additions & 6 deletions plugin/e2e-tests/src/pages/Map/Localization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ const LocalizationPage: React.FC = () => {
setCommandOutput('');
setMaps([]);
try {
const mapRef1 = document.getElementById('map1')!;
const mapRef2 = document.getElementById('map2')!;
const mapRef1 = document.getElementById('map1_localization')!;
const mapRef2 = document.getElementById('map2_localization')!;

const newMap1 = await GoogleMap.create(
{
element: mapRef1,
id: 'test-map',
id: 'test-map-localization1',
apiKey: apiKey!,
config: {
center: {
Expand All @@ -53,7 +53,7 @@ const LocalizationPage: React.FC = () => {
const newMap2 = await GoogleMap.create(
{
element: mapRef2,
id: 'test-map2',
id: 'test-map2-localization1',
apiKey: apiKey!,
config: {
center: {
Expand Down Expand Up @@ -180,7 +180,7 @@ const LocalizationPage: React.FC = () => {
<IonTextarea id="commandOutput" value={commandOutput}></IonTextarea>
</div>
<capacitor-google-map
id="map1"
id="map1_localization"
style={{
position: 'absolute',
top: window.innerHeight - window.outerWidth / 2,
Expand All @@ -190,7 +190,7 @@ const LocalizationPage: React.FC = () => {
}}
></capacitor-google-map>
<capacitor-google-map
id="map2"
id="map2_localization"
style={{
position: 'absolute',
top: window.innerHeight - window.outerWidth / 2,
Expand Down
6 changes: 3 additions & 3 deletions plugin/e2e-tests/src/pages/Map/ResizeMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ const ResizeMapPage: React.FC = () => {
setCommandOutput('');
setMap(null);
try {
const mapRef = document.getElementById('map')!;
const mapRef = document.getElementById('map_resize')!;

const newMap = await GoogleMap.create({
element: mapRef,
id: 'test-map',
id: 'test-map-resize',
apiKey: apiKey!,
config: {
center: {
Expand Down Expand Up @@ -84,7 +84,7 @@ const ResizeMapPage: React.FC = () => {
></IonTextarea>
</div>
<capacitor-google-map
id="map"
id="map_resize"
style={{
position: 'absolute',
top: window.innerHeight - window.outerWidth / 2,
Expand Down
10 changes: 5 additions & 5 deletions plugin/e2e-tests/src/pages/Markers/AddAndRemoveMarkers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const AddAndRemoveMarkers: React.FC = () => {

async function createMap() {
try {
const mapRef1 = document.getElementById("markers_map1")!
const mapRef1 = document.getElementById("markers_add_remove_map1")!
const newMap = await GoogleMap.create({
element: mapRef1,
id: "test-map",
id: "test-map-markers-add-remove",
apiKey: apiKey!,
config: {
center: {
Expand Down Expand Up @@ -150,12 +150,12 @@ const AddAndRemoveMarkers: React.FC = () => {
<div>
<IonTextarea id="commandOutput" value={commandOutput}></IonTextarea>
</div>
<capacitor-google-map id="markers_map1" style={{
<capacitor-google-map id="markers_add_remove_map1" style={{
position: "absolute",
top: window.innerHeight - 300,
top: window.innerHeight - 150,
left: 0,
width: window.innerWidth,
height: 300,
height: window.outerWidth / 2,
}}></capacitor-google-map>
</BaseTestingPage>
)
Expand Down
Loading