@@ -28,13 +28,13 @@ const CreateAndDestroyMapPage: React.FC = () => {
2828 setCommandOutput ( '' ) ;
2929 setMaps ( [ ] ) ;
3030 try {
31- const mapRef1 = document . getElementById ( 'map1 ' ) ! ;
32- const mapRef2 = document . getElementById ( 'map2 ' ) ! ;
31+ const mapRef1 = document . getElementById ( 'map1_create_destroy ' ) ! ;
32+ const mapRef2 = document . getElementById ( 'map2_create_destroy ' ) ! ;
3333
3434 const newMap1 = await GoogleMap . create (
3535 {
3636 element : mapRef1 ,
37- id : 'test-map' ,
37+ id : 'test-map-create-destroy1 ' ,
3838 apiKey : apiKey ! ,
3939 config : {
4040 center : {
@@ -51,7 +51,7 @@ const CreateAndDestroyMapPage: React.FC = () => {
5151 const newMap2 = await GoogleMap . create (
5252 {
5353 element : mapRef2 ,
54- id : 'test-map2 ' ,
54+ id : 'test-map-create-destroy2 ' ,
5555 apiKey : apiKey ! ,
5656 config : {
5757 center : {
@@ -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"
@@ -212,7 +178,7 @@ const CreateAndDestroyMapPage: React.FC = () => {
212178 < IonTextarea id = "commandOutput" value = { commandOutput } > </ IonTextarea >
213179 </ div >
214180 < capacitor-google-map
215- id = "map1 "
181+ id = "map1_create_destroy "
216182 style = { {
217183 position : 'absolute' ,
218184 top : window . innerHeight - window . outerWidth / 2 ,
@@ -222,7 +188,7 @@ const CreateAndDestroyMapPage: React.FC = () => {
222188 } }
223189 > </ capacitor-google-map >
224190 < capacitor-google-map
225- id = "map2 "
191+ id = "map2_create_destroy "
226192 style = { {
227193 position : 'absolute' ,
228194 top : window . innerHeight - window . outerWidth / 2 ,
0 commit comments