diff --git a/README.md b/README.md index 72d0eb960..e44abead2 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ This repository contains the official Capacitor plugins maintained by the Capaci | [`@capacitor/dialog`](https://capacitorjs.com/docs/apis/dialog) | [`./dialog`](./dialog) | [![npm badge](https://img.shields.io/npm/v/@capacitor/dialog?style=flat-square)](https://www.npmjs.com/package/@capacitor/dialog) | [`@capacitor/filesystem`](https://capacitorjs.com/docs/apis/filesystem) | [`./filesystem`](./filesystem) | [![npm badge](https://img.shields.io/npm/v/@capacitor/filesystem?style=flat-square)](https://www.npmjs.com/package/@capacitor/filesystem) | [`@capacitor/geolocation`](https://capacitorjs.com/docs/apis/geolocation) | [`./geolocation`](./geolocation) | [![npm badge](https://img.shields.io/npm/v/@capacitor/geolocation?style=flat-square)](https://www.npmjs.com/package/@capacitor/geolocation) -| [`@capacitor/google-maps`](https://capacitorjs.com/docs/apis/google-maps) | [`./google-maps`](./google-maps) | [![npm badge](https://img.shields.io/npm/v/@capacitor/google-maps?style=flat-square)](https://www.npmjs.com/package/@capacitor/google-maps) | [`@capacitor/haptics`](https://capacitorjs.com/docs/apis/haptics) | [`./haptics`](./haptics) | [![npm badge](https://img.shields.io/npm/v/@capacitor/haptics?style=flat-square)](https://www.npmjs.com/package/@capacitor/haptics) | [`@capacitor/keyboard`](https://capacitorjs.com/docs/apis/keyboard) | [`./keyboard`](./keyboard) | [![npm badge](https://img.shields.io/npm/v/@capacitor/keyboard?style=flat-square)](https://www.npmjs.com/package/@capacitor/keyboard) | [`@capacitor/local-notifications`](https://capacitorjs.com/docs/apis/local-notifications) | [`./local-notifications`](./local-notifications) | [![npm badge](https://img.shields.io/npm/v/@capacitor/local-notifications?style=flat-square)](https://www.npmjs.com/package/@capacitor/local-notifications) @@ -47,6 +46,7 @@ These are official Capacitor plugins that are not contained in this repository. | GitHub | Package | Version | | --- | --- | --- | | [Background Runner](https://github.com/ionic-team/capacitor-background-runner) | [`@capacitor/background-runner`](https://capacitorjs.com/docs/apis/background-runner) | [![npm badge](https://img.shields.io/npm/v/@capacitor/background-runner?style=flat-square)](https://www.npmjs.com/package/@capacitor/background-runner) | +| [Google Maps](https://github.com/ionic-team/capacitor-google-maps) | [`@capacitor/google-maps`](https://capacitorjs.com/docs/apis/google-maps) | [![npm badge](https://img.shields.io/npm/v/@capacitor/google-maps?style=flat-square)](https://www.npmjs.com/package/@capacitor/google-maps) | ## Capacitor Labs diff --git a/google-maps/.eslintignore b/google-maps/.eslintignore deleted file mode 100644 index 179ca25ab..000000000 --- a/google-maps/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -build -dist -e2e-tests -unit-tests \ No newline at end of file diff --git a/google-maps/.gitignore b/google-maps/.gitignore deleted file mode 100644 index 482d6d236..000000000 --- a/google-maps/.gitignore +++ /dev/null @@ -1,62 +0,0 @@ -# node files -dist -node_modules - -# iOS files -Pods -Podfile.lock -Build -xcuserdata - -# macOS files -.DS_Store - - - -# Based on Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore - -# Built application files -*.apk -*.ap_ - -# Files for the ART/Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin -gen -out - -# Gradle files -.gradle -build - -# Local configuration file (sdk path, etc) -local.properties - -# Proguard folder generated by Eclipse -proguard - -# Log Files -*.log - -# Android Studio Navigation editor temp files -.navigation - -# Android Studio captures folder -captures - -# IntelliJ -*.iml -.idea - -# Keystore files -# Uncomment the following line if you do not want to check your keystore files in. -#*.jks - -# External native build folder generated in Android Studio 2.2 and later -.externalNativeBuild -*.tgz diff --git a/google-maps/.prettierignore b/google-maps/.prettierignore deleted file mode 100644 index 1cb23c439..000000000 --- a/google-maps/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -build -dist -e2e-tests -unit-tests diff --git a/google-maps/CHANGELOG.md b/google-maps/CHANGELOG.md deleted file mode 100644 index a6ae67a4c..000000000 --- a/google-maps/CHANGELOG.md +++ /dev/null @@ -1,250 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# [6.0.0-rc.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@6.0.0-beta.1...@capacitor/google-maps@6.0.0-rc.0) (2024-02-07) - -**Note:** Version bump only for package @capacitor/google-maps - -# [6.0.0-beta.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@6.0.0-beta.0...@capacitor/google-maps@6.0.0-beta.1) (2023-12-14) - -**Note:** Version bump only for package @capacitor/google-maps - -# [6.0.0-beta.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@6.0.0-alpha.2...@capacitor/google-maps@6.0.0-beta.0) (2023-12-13) - -**Note:** Version bump only for package @capacitor/google-maps - -# [6.0.0-alpha.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@6.0.0-alpha.1...@capacitor/google-maps@6.0.0-alpha.2) (2023-11-15) - -**Note:** Version bump only for package @capacitor/google-maps - -# [6.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.3.0...@capacitor/google-maps@6.0.0-alpha.1) (2023-11-08) - -### Bug Fixes - -- **google-maps:** Apply iconAnchor value to Marker anchor on Android ([#1814](https://github.com/ionic-team/capacitor-plugins/issues/1814)) ([5a8399e](https://github.com/ionic-team/capacitor-plugins/commit/5a8399e4a05b4885036271c18dd22c6841ac8a4c)) -- **google-maps:** attach native map view to correct scroll view ([#1638](https://github.com/ionic-team/capacitor-plugins/issues/1638)) ([dfe6043](https://github.com/ionic-team/capacitor-plugins/commit/dfe6043e8cbeb9aeabe847f62341dcaae674951a)) -- **google-maps:** correctly apply CapacitorGoogleMapsPoint y value ([#1800](https://github.com/ionic-team/capacitor-plugins/issues/1800)) ([338953f](https://github.com/ionic-team/capacitor-plugins/commit/338953f41cfc5b1a55832df5d94928465d7ce10e)) -- **google-maps:** problems on get/setMapType on web ([#1738](https://github.com/ionic-team/capacitor-plugins/issues/1738)) ([a23202f](https://github.com/ionic-team/capacitor-plugins/commit/a23202fce338899e4ffa23b948ddd7394af127e0)) -- **google-maps:** use URLSession for remote iconUrl on iOS ([#1818](https://github.com/ionic-team/capacitor-plugins/issues/1818)) ([da5fc51](https://github.com/ionic-team/capacitor-plugins/commit/da5fc5100466db0f9f2de0872ca5fa86465b225b)) - -### Features - -- **google-maps:** Separate mapId for Google Maps Cloud IDs ([#1750](https://github.com/ionic-team/capacitor-plugins/issues/1750)) ([88a633c](https://github.com/ionic-team/capacitor-plugins/commit/88a633ccab6753fe2559a9b8b55a697022fe327c)) - -# [5.4.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.3.3...@capacitor/google-maps@5.4.0) (2023-12-15) - -### Features - -- **google-maps:** Separate mapId for Google Maps Cloud IDs ([#1943](https://github.com/ionic-team/capacitor-plugins/issues/1943)) ([bf7ec33](https://github.com/ionic-team/capacitor-plugins/commit/bf7ec3306e7943358ac9ea118b904ff27d6ea2f6)) - -## [5.3.3](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.3.2...@capacitor/google-maps@5.3.3) (2023-10-04) - -### Bug Fixes - -- **google-maps:** Apply iconAnchor value to Marker anchor on Android ([#1822](https://github.com/ionic-team/capacitor-plugins/issues/1822)) ([ef65656](https://github.com/ionic-team/capacitor-plugins/commit/ef656564518d03624d5d74a3ca173a53594ec4ba)) -- **google-maps:** correctly apply CapacitorGoogleMapsPoint y value ([#1815](https://github.com/ionic-team/capacitor-plugins/issues/1815)) ([3c7e531](https://github.com/ionic-team/capacitor-plugins/commit/3c7e531dc1e49fa2a3267cdae3dda2379e62c005)) -- **google-maps:** use URLSession for remote iconUrl on iOS ([#1818](https://github.com/ionic-team/capacitor-plugins/issues/1818)) ([#1824](https://github.com/ionic-team/capacitor-plugins/issues/1824)) ([73ad64b](https://github.com/ionic-team/capacitor-plugins/commit/73ad64b665406d028cf2e171da89801a0ea9cf78)) - -## [5.3.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.3.1...@capacitor/google-maps@5.3.2) (2023-09-14) - -**Note:** Version bump only for package @capacitor/google-maps - -## [5.3.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.3.0...@capacitor/google-maps@5.3.1) (2023-08-23) - -### Bug Fixes - -- **google-maps:** attach native map view to correct scroll view ([#1638](https://github.com/ionic-team/capacitor-plugins/issues/1638)) ([dfe6043](https://github.com/ionic-team/capacitor-plugins/commit/dfe6043e8cbeb9aeabe847f62341dcaae674951a)) -- **google-maps:** problems on get/setMapType on web ([#1738](https://github.com/ionic-team/capacitor-plugins/issues/1738)) ([a23202f](https://github.com/ionic-team/capacitor-plugins/commit/a23202fce338899e4ffa23b948ddd7394af127e0)) - -# [5.3.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.2.2...@capacitor/google-maps@5.3.0) (2023-08-09) - -### Features - -- **google-maps:** Added feature to disable touch events on map ([#1601](https://github.com/ionic-team/capacitor-plugins/issues/1601)) ([c4e3871](https://github.com/ionic-team/capacitor-plugins/commit/c4e387102b42f403970c10fbf82409c8a55bd361)) -- **google-maps:** Update map size in updateRender method if it has changed ([#1595](https://github.com/ionic-team/capacitor-plugins/issues/1595)) ([318fc40](https://github.com/ionic-team/capacitor-plugins/commit/318fc40b9b117a46e51fe910e4e02ef9c8e85c92)) - -## [5.2.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.2.1...@capacitor/google-maps@5.2.2) (2023-07-19) - -**Note:** Version bump only for package @capacitor/google-maps - -## [5.2.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.2.0...@capacitor/google-maps@5.2.1) (2023-07-12) - -### Bug Fixes - -- **google-maps:** Add missing listeners to removeAllMapListeners ([#1672](https://github.com/ionic-team/capacitor-plugins/issues/1672)) ([7e1911d](https://github.com/ionic-team/capacitor-plugins/commit/7e1911d6cd192a023938bf30d0ca9f573d6076e6)) - -# [5.2.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.1.2...@capacitor/google-maps@5.2.0) (2023-06-29) - -### Bug Fixes - -- **google-maps:** Apply zIndex for marker in Android and default to 0 ([#1645](https://github.com/ionic-team/capacitor-plugins/issues/1645)) ([fc91569](https://github.com/ionic-team/capacitor-plugins/commit/fc91569dbfe8bee15c405e50d0720c112e2b4979)) - -### Features - -- **google-maps:** add fitBounds to Map object ([f4ae690](https://github.com/ionic-team/capacitor-plugins/commit/f4ae690fbddfc2bad9a931d4a987499eed63a09b)) - -## [5.1.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.1.1...@capacitor/google-maps@5.1.2) (2023-06-08) - -**Note:** Version bump only for package @capacitor/google-maps - -## [5.1.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.1.0...@capacitor/google-maps@5.1.1) (2023-06-08) - -**Note:** Version bump only for package @capacitor/google-maps - -# [5.1.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.0.1...@capacitor/google-maps@5.1.0) (2023-05-09) - -### Bug Fixes - -- **google-maps:** Added null check to addMarkers method ([#1571](https://github.com/ionic-team/capacitor-plugins/issues/1571)) ([76e89a9](https://github.com/ionic-team/capacitor-plugins/commit/76e89a9a7ee4a7aa9aead02366a5ab7e16470cd4)) - -### Features - -- **google-maps:** Add ability to set language and region on map ([#1588](https://github.com/ionic-team/capacitor-plugins/issues/1588)) ([c4a296c](https://github.com/ionic-team/capacitor-plugins/commit/c4a296cb17746d454de7d805bd178362d6a5ae48)) - -## [5.0.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.0.0...@capacitor/google-maps@5.0.1) (2023-05-05) - -### Bug Fixes - -- Use Capacitor 5 final ([#1574](https://github.com/ionic-team/capacitor-plugins/issues/1574)) ([139c18b](https://github.com/ionic-team/capacitor-plugins/commit/139c18b86a11d31246e952d1a74335ff8ce5dbc2)) - -# [5.0.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.0.0-beta.1...@capacitor/google-maps@5.0.0) (2023-05-03) - -**Note:** Version bump only for package @capacitor/google-maps - -# [5.0.0-beta.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.0.0-beta.0...@capacitor/google-maps@5.0.0-beta.1) (2023-04-21) - -### Bug Fixes - -- **google-maps:** Cast iOS marker id to string ([#1222](https://github.com/ionic-team/capacitor-plugins/issues/1222)) ([0ffb621](https://github.com/ionic-team/capacitor-plugins/commit/0ffb62159bbdb38cf3657ca15f7e69573d83a792)) -- **google-maps:** fix custom icon on marker when clustering is enabled ([#1522](https://github.com/ionic-team/capacitor-plugins/issues/1522)) ([12be06a](https://github.com/ionic-team/capacitor-plugins/commit/12be06a1de1adc2e961cdd6837f203c19343ad8d)) - -### Features - -- **google-maps:** Circles support ([#1553](https://github.com/ionic-team/capacitor-plugins/issues/1553)) ([c39d84f](https://github.com/ionic-team/capacitor-plugins/commit/c39d84fbae464fc8984e26f970e85fd1862ff2ac)) -- **google-maps:** Polygons support ([#1534](https://github.com/ionic-team/capacitor-plugins/issues/1534)) ([e2fd153](https://github.com/ionic-team/capacitor-plugins/commit/e2fd15318d0ba9a07386d0389d985ec65071341e)) -- **google-maps:** Polylines support ([#1532](https://github.com/ionic-team/capacitor-plugins/issues/1532)) ([415f42b](https://github.com/ionic-team/capacitor-plugins/commit/415f42b351d4ac8fd555efc3d6b0dfa9b09a80b9)) -- Update gradle to 8.0.2 and gradle plugin to 8.0.0 ([#1542](https://github.com/ionic-team/capacitor-plugins/issues/1542)) ([e7210b4](https://github.com/ionic-team/capacitor-plugins/commit/e7210b47867644f5983e37acdbf0247214ec232d)) - -# [5.0.0-beta.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@5.0.0-alpha.1...@capacitor/google-maps@5.0.0-beta.0) (2023-03-31) - -### Bug Fixes - -- **google-maps:** setMapType not working on web ([#1508](https://github.com/ionic-team/capacitor-plugins/issues/1508)) ([4efa7d7](https://github.com/ionic-team/capacitor-plugins/commit/4efa7d7ccc0a48f61131bb8f729de13ac7b00fb3)) - -### Features - -- **google-maps:** add extend to LatLngBounds ([fb2dc0d](https://github.com/ionic-team/capacitor-plugins/commit/fb2dc0d42f9eaa928e9bdb38980ac9b84ae4c4b7)) - -# [5.0.0-alpha.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@4.5.0...@capacitor/google-maps@5.0.0-alpha.1) (2023-03-16) - -### Features - -- **android:** Removing enableJetifier ([d66f9cb](https://github.com/ionic-team/capacitor-plugins/commit/d66f9cbd9da7e3b1d8c64ca6a5b45156867d4a04)) -- **google-maps:** add zIndex to markers ([53a0436](https://github.com/ionic-team/capacitor-plugins/commit/53a04366ad331ada081589aef9c726b4356688df)) - -# [4.5.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@4.4.0...@capacitor/google-maps@4.5.0) (2023-02-22) - -### Bug Fixes - -- **google-maps/android:** dispatch touch events to correct y position ([#1415](https://github.com/ionic-team/capacitor-plugins/issues/1415)) ([87e9a6e](https://github.com/ionic-team/capacitor-plugins/commit/87e9a6e97f843228c62245a80eeb6cb86d43500e)) - -### Features - -- **google-maps:** add contains to LatLngBounds ([a6b9962](https://github.com/ionic-team/capacitor-plugins/commit/a6b9962f1b6d6c2f873dd8c373b7aa16a49eff6d)) -- **google-maps:** Add getMapType method ([#1420](https://github.com/ionic-team/capacitor-plugins/issues/1420)) ([c2fa96f](https://github.com/ionic-team/capacitor-plugins/commit/c2fa96fc709b59fa55a6f61ecb4d80be214982c5)) - -# [4.4.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@4.3.2...@capacitor/google-maps@4.4.0) (2023-02-03) - -### Bug Fixes - -- **google-maps/android:** update clusters on map move ([#1398](https://github.com/ionic-team/capacitor-plugins/issues/1398)) ([3a23238](https://github.com/ionic-team/capacitor-plugins/commit/3a2323833779d9b545140057070f5acda38d9b32)) - -### Features - -- **google-maps:** Add minClusterSize setting for enableClustering ([#1399](https://github.com/ionic-team/capacitor-plugins/issues/1399)) ([fba34b8](https://github.com/ionic-team/capacitor-plugins/commit/fba34b823e60aba43f82761bf7c3b42675702b7f)) - -## [4.3.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@4.3.1...@capacitor/google-maps@4.3.2) (2022-12-01) - -**Note:** Version bump only for package @capacitor/google-maps - -## [4.3.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@4.3.0...@capacitor/google-maps@4.3.1) (2022-11-16) - -### Bug Fixes - -- **google-maps:** install google.maps types as dependency ([#1269](https://github.com/ionic-team/capacitor-plugins/issues/1269)) ([6cc7783](https://github.com/ionic-team/capacitor-plugins/commit/6cc77835d301f9c7734ae8a25dd0fc08ea91c74a)) -- **google-maps:** Remove log of marker options ([#1247](https://github.com/ionic-team/capacitor-plugins/issues/1247)) ([5bb3000](https://github.com/ionic-team/capacitor-plugins/commit/5bb30005df075ce1679695792e33f398eee298c4)) -- **google-maps:** Retry getting the map size if it's 0 ([#1252](https://github.com/ionic-team/capacitor-plugins/issues/1252)) ([9bffdb5](https://github.com/ionic-team/capacitor-plugins/commit/9bffdb529f41cadc2e5a33c4a09d5ebfacf4baed)) - -# [4.3.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@4.2.1...@capacitor/google-maps@4.3.0) (2022-10-21) - -### Bug Fixes - -- **google-maps:** allow remote marker icons on native platforms ([#1216](https://github.com/ionic-team/capacitor-plugins/issues/1216)) ([8b4de64](https://github.com/ionic-team/capacitor-plugins/commit/8b4de6435decf5d37c29ac6d543191f32b5a6c6e)) -- **google-maps:** allow to resize icons with same image ([#1228](https://github.com/ionic-team/capacitor-plugins/issues/1228)) ([f6522d3](https://github.com/ionic-team/capacitor-plugins/commit/f6522d37c1418933207ee9a54d08222fcf264334)) -- **google-maps:** event listeners not firing when clustering enabled ([dd80da2](https://github.com/ionic-team/capacitor-plugins/commit/dd80da263ba684463fa35c9cff3a237ffd257058)) - -### Features - -- **google-maps:** Add more config options ([#1233](https://github.com/ionic-team/capacitor-plugins/issues/1233)) ([8bebf97](https://github.com/ionic-team/capacitor-plugins/commit/8bebf9745f6538d4bc7f1622b2b4a0317f306bfb)) - -## [4.2.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@4.2.0...@capacitor/google-maps@4.2.1) (2022-09-29) - -### Bug Fixes - -- **google-maps:** adding missing marker draggable property for web ([#1184](https://github.com/ionic-team/capacitor-plugins/issues/1184)) ([2eb0e7e](https://github.com/ionic-team/capacitor-plugins/commit/2eb0e7e6db9d3f6a684d2c9a0e2e7ec94d5dfa63)) -- **google-maps:** onClusterClickHandler not getting marker ids on web ([#1039](https://github.com/ionic-team/capacitor-plugins/issues/1039)) ([b04e32d](https://github.com/ionic-team/capacitor-plugins/commit/b04e32d6fcab39285ba6dbe49408e001177cf13f)) - -# [4.2.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@4.1.0...@capacitor/google-maps@4.2.0) (2022-09-12) - -### Features - -- **google-maps:** Marker Customization Options ([#1146](https://github.com/ionic-team/capacitor-plugins/issues/1146)) ([bb77432](https://github.com/ionic-team/capacitor-plugins/commit/bb77432ac28ec5de5c5d2584f4f2ccf874e5c197)) -- **google-maps:** Marker Drag Listeners ([833f28d](https://github.com/ionic-team/capacitor-plugins/commit/833f28dc8e28553673c861619a2ac9540f39e33a)) - -# [4.1.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/google-maps@1.1.0...@capacitor/google-maps@4.1.0) (2022-08-24) - -### Bug Fixes - -- **google-maps:** Check for WKScrollView and WKChildScrollView ([#1109](https://github.com/ionic-team/capacitor-plugins/issues/1109)) ([7513602](https://github.com/ionic-team/capacitor-plugins/commit/7513602c6c9830de305e6097db3023e42a8afa30)) - -## [4.0.1](https://github.com/ionic-team/capacitor-plugins/compare/4.0.0...4.0.1) (2022-07-28) - -**Note:** Version bump only for package @capacitor/google-maps - -# [4.0.0](https://github.com/ionic-team/capacitor-plugins/compare/4.0.0-beta.2...4.0.0) (2022-07-27) - -**Note:** Version bump only for package @capacitor/google-maps - -# [4.0.0-beta.2](https://github.com/ionic-team/capacitor-plugins/compare/4.0.0-beta.0...4.0.0-beta.2) (2022-07-08) - -### Features - -- **google-maps:** provides variables for configuring dependencies ([#1063](https://github.com/ionic-team/capacitor-plugins/issues/1063)) ([5c077f1](https://github.com/ionic-team/capacitor-plugins/commit/5c077f199cbd16b459a77061509e0504029f78db)) - -# 4.0.0-beta.0 (2022-06-27) - -### Bug Fixes - -- **google-maps:** correctly typed event listeners ([656f916](https://github.com/ionic-team/capacitor-plugins/commit/656f9169ccd8d7fa880143b13ca5f62bb546edb0)) -- **google-maps:** Fixing map touch events on Android ([7cb89fb](https://github.com/ionic-team/capacitor-plugins/commit/7cb89fb788e05aa9e90c39698e041ebe094132ea)) - -### Features - -- **google-maps:** Google Maps Bounds ([14a045d](https://github.com/ionic-team/capacitor-plugins/commit/14a045d3880124996b2770cec7b3e28a9f13d231)) - -# 1.1.0 (2022-06-17) - -### Bug Fixes - -- **google-maps:** correctly typed event listeners ([656f916](https://github.com/ionic-team/capacitor-plugins/commit/656f9169ccd8d7fa880143b13ca5f62bb546edb0)) -- **google-maps:** Fixing map touch events on Android ([7cb89fb](https://github.com/ionic-team/capacitor-plugins/commit/7cb89fb788e05aa9e90c39698e041ebe094132ea)) - -### Features - -- **google-maps:** Google Maps Bounds ([14a045d](https://github.com/ionic-team/capacitor-plugins/commit/14a045d3880124996b2770cec7b3e28a9f13d231)) - -# [1.0.0](https://github.com/ionic-team/capacitor-plugins/tree/main/google-maps) (2022-04-28) - -**Note:** Version bump only for package @capacitor/google-maps diff --git a/google-maps/CapacitorGoogleMaps.podspec b/google-maps/CapacitorGoogleMaps.podspec deleted file mode 100644 index 8e8880740..000000000 --- a/google-maps/CapacitorGoogleMaps.podspec +++ /dev/null @@ -1,20 +0,0 @@ -require 'json' - -package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) - -Pod::Spec.new do |s| - s.name = 'CapacitorGoogleMaps' - s.version = package['version'] - s.summary = package['description'] - s.license = package['license'] - s.homepage = 'https://capacitorjs.com' - s.author = package['author'] - s.source = { :git => 'https://github.com/ionic-team/capacitor-plugins.git', :tag => package['name'] + '@' + package['version'] } - s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}', 'google-maps/ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '13.0' - s.dependency 'Capacitor' - s.dependency 'GoogleMaps', '~> 7.4' - s.dependency 'Google-Maps-iOS-Utils', '~> 4.2' - s.swift_version = '5.1' - s.static_framework = true -end diff --git a/google-maps/README.md b/google-maps/README.md deleted file mode 100644 index 0d858c28b..000000000 --- a/google-maps/README.md +++ /dev/null @@ -1,1171 +0,0 @@ -# @capacitor/google-maps - -Google maps on Capacitor - -## Install - -```bash -npm install @capacitor/google-maps -npx cap sync -``` - -## API Keys - -To use the Google Maps SDK on any platform, API keys associated with an account _with billing enabled_ are required. These can be obtained from the [Google Cloud Console](https://console.cloud.google.com). This is required for all three platforms, Android, iOS, and Javascript. Additional information about obtaining these API keys can be found in the [Google Maps documentation](https://developers.google.com/maps/documentation/android-sdk/overview) for each platform. - -## iOS - -The Google Maps SDK supports the use of showing the users current location via `enableCurrentLocation(bool)`. To use this, Apple requires privacy descriptions to be specified in `Info.plist`: - -- `NSLocationWhenInUseUsageDescription` (`Privacy - Location When In Use Usage Description`) - -Read about [Configuring `Info.plist`](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) in the [iOS Guide](https://capacitorjs.com/docs/ios) for more information on setting iOS permissions in Xcode. - -> The main Google Maps SDK now supports running on simulators on Apple Silicon Macs, but make sure you have the latest version of [Google-Maps-iOS-Utils](https://github.com/googlemaps/google-maps-ios-utils) installed. - -If you added the previous workaround for getting the unreleased version, you can delete it now by removing this line from `ios/App/Podfile`: - -``` -pod 'Google-Maps-iOS-Utils', :git => 'https://github.com/googlemaps/google-maps-ios-utils.git', :commit => '637954e5bcb2a879c11a6f2cead153a6bad5339f' -``` - -Then run `pod update Google-Maps-iOS-Utils` from the `ios/App/` folder: - -``` -cd ios/App -pod update Google-Maps-iOS-Utils -``` - -## Android - -The Google Maps SDK for Android requires you to add your API key to the AndroidManifest.xml file in your project. - -```xml - -``` - -To use certain location features, the SDK requires the following permissions to also be added to your AndroidManifest.xml: - -```xml - - -``` - -### Variables - -This plugin will use the following project variables (defined in your app's `variables.gradle` file): - -- `googleMapsPlayServicesVersion`: version of `com.google.android.gms:play-services-maps` (default: `18.2.0`) -- `googleMapsUtilsVersion`: version of `com.google.maps.android:android-maps-utils` (default: `3.8.2`) -- `googleMapsKtxVersion`: version of `com.google.maps.android:maps-ktx` (default: `5.0.0`) -- `googleMapsUtilsKtxVersion`: version of `com.google.maps.android:maps-utils-ktx` (default: `5.0.0`) -- `kotlinxCoroutinesVersion`: version of `org.jetbrains.kotlinx:kotlinx-coroutines-android` and `org.jetbrains.kotlinx:kotlinx-coroutines-core` (default: `1.7.3`) -- `androidxCoreKTXVersion`: version of `androidx.core:core-ktx` (default: `1.12.0`) -- `kotlin_version`: version of `org.jetbrains.kotlin:kotlin-stdlib` (default: `1.9.10`) - - -## Usage - -The Google Maps Capacitor plugin ships with a web component that must be used to render the map in your application as it enables us to embed the native view more effectively on iOS. The plugin will automatically register this web component for use in your application. - -> For Angular users, you will get an error warning that this web component is unknown to the Angular compiler. This is resolved by modifying the module that declares your component to allow for custom web components. -> -> ```typescript -> import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -> -> @NgModule({ -> schemas: [CUSTOM_ELEMENTS_SCHEMA] -> }) -> ``` - -Include this component in your HTML and assign it an ID so that you can easily query for that element reference later. - -```html - -``` - -> On Android, the map is rendered beneath the entire webview, and uses this component to manage its positioning during scrolling events. This means that as the developer, you _must_ ensure that the webview is transparent all the way through the layers to the very bottom. In a typically Ionic application, that means setting transparency on elements such as IonContent and the root HTML tag to ensure that it can be seen. If you can't see your map on Android, this should be the first thing you check. -> -> On iOS, we render the map directly into the webview and so the same transparency effects are not required. We are investigating alternate methods for Android still and hope to resolve this better in a future update. - -The Google Map element itself comes unstyled, so you should style it to fit within the layout of your page structure. Because we're rendering a view into this slot, by itself the element has no width or height, so be sure to set those explicitly. - -```css -capacitor-google-map { - display: inline-block; - width: 275px; - height: 400px; -} -``` - -Next, we should create the map reference. This is done by importing the GoogleMap class from the Capacitor plugin and calling the create method, and passing in the required parameters. - -```typescript -import { GoogleMap } from '@capacitor/google-maps'; - -const apiKey = 'YOUR_API_KEY_HERE'; - -const mapRef = document.getElementById('map'); - -const newMap = await GoogleMap.create({ - id: 'my-map', // Unique identifier for this map instance - element: mapRef, // reference to the capacitor-google-map element - apiKey: apiKey, // Your Google Maps API Key - config: { - center: { - // The initial position to be rendered by the map - lat: 33.6, - lng: -117.9, - }, - zoom: 8, // The initial zoom level to be rendered by the map - }, -}); -``` - -At this point, your map should be created within your application. Using the returned reference to the map, you can easily interact with your map in a number of way, a few of which are shown here. - -```typescript -const newMap = await GoogleMap.create({...}); - -// Add a marker to the map -const markerId = await newMap.addMarker({ - coordinate: { - lat: 33.6, - lng: -117.9 - } -}); - -// Move the map programmatically -await newMap.setCamera({ - coordinate: { - lat: 33.6, - lng: -117.9 - } -}); - -// Enable marker clustering -await newMap.enableClustering(); - -// Handle marker click -await newMap.setOnMarkerClickListener((event) => {...}); - -// Clean up map reference -await newMap.destroy(); -``` - -## Full Examples - -### Angular - -```typescript -import { GoogleMap } from '@capacitor/google-maps'; - -@Component({ - template: ` - - - `, - styles: [ - ` - capacitor-google-map { - display: inline-block; - width: 275px; - height: 400px; - } - `, - ], -}) -export class MyMap { - @ViewChild('map') - mapRef: ElementRef; - newMap: GoogleMap; - - async createMap() { - this.newMap = await GoogleMap.create({ - id: 'my-cool-map', - element: this.mapRef.nativeElement, - apiKey: environment.apiKey, - config: { - center: { - lat: 33.6, - lng: -117.9, - }, - zoom: 8, - }, - }); - } -} -``` - -### React - -```jsx -import { GoogleMap } from '@capacitor/google-maps'; -import { useRef } from 'react'; - -const MyMap: React.FC = () => { - const mapRef = useRef(); - let newMap: GoogleMap; - - async function createMap() { - if (!mapRef.current) return; - - newMap = await GoogleMap.create({ - id: 'my-cool-map', - element: mapRef.current, - apiKey: process.env.REACT_APP_YOUR_API_KEY_HERE, - config: { - center: { - lat: 33.6, - lng: -117.9 - }, - zoom: 8 - } - }) - } - - return ( -
- - - -
- ) -} - -export default MyMap; -``` - -### Javascript - -```html - - - - - - -``` - -## API - - - -* [`create(...)`](#create) -* [`enableTouch()`](#enabletouch) -* [`disableTouch()`](#disabletouch) -* [`enableClustering(...)`](#enableclustering) -* [`disableClustering()`](#disableclustering) -* [`addMarker(...)`](#addmarker) -* [`addMarkers(...)`](#addmarkers) -* [`removeMarker(...)`](#removemarker) -* [`removeMarkers(...)`](#removemarkers) -* [`addPolygons(...)`](#addpolygons) -* [`removePolygons(...)`](#removepolygons) -* [`addCircles(...)`](#addcircles) -* [`removeCircles(...)`](#removecircles) -* [`addPolylines(...)`](#addpolylines) -* [`removePolylines(...)`](#removepolylines) -* [`destroy()`](#destroy) -* [`setCamera(...)`](#setcamera) -* [`getMapType()`](#getmaptype) -* [`setMapType(...)`](#setmaptype) -* [`enableIndoorMaps(...)`](#enableindoormaps) -* [`enableTrafficLayer(...)`](#enabletrafficlayer) -* [`enableAccessibilityElements(...)`](#enableaccessibilityelements) -* [`enableCurrentLocation(...)`](#enablecurrentlocation) -* [`setPadding(...)`](#setpadding) -* [`fitBounds(...)`](#fitbounds) -* [`setOnBoundsChangedListener(...)`](#setonboundschangedlistener) -* [`setOnCameraIdleListener(...)`](#setoncameraidlelistener) -* [`setOnCameraMoveStartedListener(...)`](#setoncameramovestartedlistener) -* [`setOnClusterClickListener(...)`](#setonclusterclicklistener) -* [`setOnClusterInfoWindowClickListener(...)`](#setonclusterinfowindowclicklistener) -* [`setOnInfoWindowClickListener(...)`](#setoninfowindowclicklistener) -* [`setOnMapClickListener(...)`](#setonmapclicklistener) -* [`setOnMarkerClickListener(...)`](#setonmarkerclicklistener) -* [`setOnPolygonClickListener(...)`](#setonpolygonclicklistener) -* [`setOnCircleClickListener(...)`](#setoncircleclicklistener) -* [`setOnPolylineClickListener(...)`](#setonpolylineclicklistener) -* [`setOnMarkerDragStartListener(...)`](#setonmarkerdragstartlistener) -* [`setOnMarkerDragListener(...)`](#setonmarkerdraglistener) -* [`setOnMarkerDragEndListener(...)`](#setonmarkerdragendlistener) -* [`setOnMyLocationButtonClickListener(...)`](#setonmylocationbuttonclicklistener) -* [`setOnMyLocationClickListener(...)`](#setonmylocationclicklistener) -* [Interfaces](#interfaces) -* [Type Aliases](#type-aliases) -* [Enums](#enums) - - - - - - -### create(...) - -```typescript -create(options: CreateMapArgs, callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| **`options`** | CreateMapArgs | -| **`callback`** | MapListenerCallback<MapReadyCallbackData> | - -**Returns:** Promise<GoogleMap> - --------------------- - - -### enableTouch() - -```typescript -enableTouch() => Promise -``` - --------------------- - - -### disableTouch() - -```typescript -disableTouch() => Promise -``` - --------------------- - - -### enableClustering(...) - -```typescript -enableClustering(minClusterSize?: number | undefined) => Promise -``` - -| Param | Type | Description | -| -------------------- | ------------------- | --------------------------------------------------------------------------------------- | -| **`minClusterSize`** | number | The minimum number of markers that can be clustered together. The default is 4 markers. | - --------------------- - - -### disableClustering() - -```typescript -disableClustering() => Promise -``` - --------------------- - - -### addMarker(...) - -```typescript -addMarker(marker: Marker) => Promise -``` - -| Param | Type | -| ------------ | ----------------------------------------- | -| **`marker`** | Marker | - -**Returns:** Promise<string> - --------------------- - - -### addMarkers(...) - -```typescript -addMarkers(markers: Marker[]) => Promise -``` - -| Param | Type | -| ------------- | --------------------- | -| **`markers`** | Marker[] | - -**Returns:** Promise<string[]> - --------------------- - - -### removeMarker(...) - -```typescript -removeMarker(id: string) => Promise -``` - -| Param | Type | -| -------- | ------------------- | -| **`id`** | string | - --------------------- - - -### removeMarkers(...) - -```typescript -removeMarkers(ids: string[]) => Promise -``` - -| Param | Type | -| --------- | --------------------- | -| **`ids`** | string[] | - --------------------- - - -### addPolygons(...) - -```typescript -addPolygons(polygons: Polygon[]) => Promise -``` - -| Param | Type | -| -------------- | ---------------------- | -| **`polygons`** | Polygon[] | - -**Returns:** Promise<string[]> - --------------------- - - -### removePolygons(...) - -```typescript -removePolygons(ids: string[]) => Promise -``` - -| Param | Type | -| --------- | --------------------- | -| **`ids`** | string[] | - --------------------- - - -### addCircles(...) - -```typescript -addCircles(circles: Circle[]) => Promise -``` - -| Param | Type | -| ------------- | --------------------- | -| **`circles`** | Circle[] | - -**Returns:** Promise<string[]> - --------------------- - - -### removeCircles(...) - -```typescript -removeCircles(ids: string[]) => Promise -``` - -| Param | Type | -| --------- | --------------------- | -| **`ids`** | string[] | - --------------------- - - -### addPolylines(...) - -```typescript -addPolylines(polylines: Polyline[]) => Promise -``` - -| Param | Type | -| --------------- | ----------------------- | -| **`polylines`** | Polyline[] | - -**Returns:** Promise<string[]> - --------------------- - - -### removePolylines(...) - -```typescript -removePolylines(ids: string[]) => Promise -``` - -| Param | Type | -| --------- | --------------------- | -| **`ids`** | string[] | - --------------------- - - -### destroy() - -```typescript -destroy() => Promise -``` - --------------------- - - -### setCamera(...) - -```typescript -setCamera(config: CameraConfig) => Promise -``` - -| Param | Type | -| ------------ | ----------------------------------------------------- | -| **`config`** | CameraConfig | - --------------------- - - -### getMapType() - -```typescript -getMapType() => Promise -``` - -Get current map type - -**Returns:** Promise<MapType> - --------------------- - - -### setMapType(...) - -```typescript -setMapType(mapType: MapType) => Promise -``` - -| Param | Type | -| ------------- | ------------------------------------------- | -| **`mapType`** | MapType | - --------------------- - - -### enableIndoorMaps(...) - -```typescript -enableIndoorMaps(enabled: boolean) => Promise -``` - -| Param | Type | -| ------------- | -------------------- | -| **`enabled`** | boolean | - --------------------- - - -### enableTrafficLayer(...) - -```typescript -enableTrafficLayer(enabled: boolean) => Promise -``` - -| Param | Type | -| ------------- | -------------------- | -| **`enabled`** | boolean | - --------------------- - - -### enableAccessibilityElements(...) - -```typescript -enableAccessibilityElements(enabled: boolean) => Promise -``` - -| Param | Type | -| ------------- | -------------------- | -| **`enabled`** | boolean | - --------------------- - - -### enableCurrentLocation(...) - -```typescript -enableCurrentLocation(enabled: boolean) => Promise -``` - -| Param | Type | -| ------------- | -------------------- | -| **`enabled`** | boolean | - --------------------- - - -### setPadding(...) - -```typescript -setPadding(padding: MapPadding) => Promise -``` - -| Param | Type | -| ------------- | ------------------------------------------------- | -| **`padding`** | MapPadding | - --------------------- - - -### fitBounds(...) - -```typescript -fitBounds(bounds: LatLngBounds, padding?: number | undefined) => Promise -``` - -Sets the map viewport to contain the given bounds. - -| Param | Type | Description | -| ------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| **`bounds`** | LatLngBounds | The bounds to fit in the viewport. | -| **`padding`** | number | Optional padding to apply in pixels. The bounds will be fit in the part of the map that remains after padding is removed. | - --------------------- - - -### setOnBoundsChangedListener(...) - -```typescript -setOnBoundsChangedListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<CameraIdleCallbackData> | - --------------------- - - -### setOnCameraIdleListener(...) - -```typescript -setOnCameraIdleListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<CameraIdleCallbackData> | - --------------------- - - -### setOnCameraMoveStartedListener(...) - -```typescript -setOnCameraMoveStartedListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<CameraMoveStartedCallbackData> | - --------------------- - - -### setOnClusterClickListener(...) - -```typescript -setOnClusterClickListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<ClusterClickCallbackData> | - --------------------- - - -### setOnClusterInfoWindowClickListener(...) - -```typescript -setOnClusterInfoWindowClickListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<ClusterClickCallbackData> | - --------------------- - - -### setOnInfoWindowClickListener(...) - -```typescript -setOnInfoWindowClickListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<MarkerClickCallbackData> | - --------------------- - - -### setOnMapClickListener(...) - -```typescript -setOnMapClickListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<MapClickCallbackData> | - --------------------- - - -### setOnMarkerClickListener(...) - -```typescript -setOnMarkerClickListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<MarkerClickCallbackData> | - --------------------- - - -### setOnPolygonClickListener(...) - -```typescript -setOnPolygonClickListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<PolygonClickCallbackData> | - --------------------- - - -### setOnCircleClickListener(...) - -```typescript -setOnCircleClickListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<CircleClickCallbackData> | - --------------------- - - -### setOnPolylineClickListener(...) - -```typescript -setOnPolylineClickListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<PolylineCallbackData> | - --------------------- - - -### setOnMarkerDragStartListener(...) - -```typescript -setOnMarkerDragStartListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<MarkerClickCallbackData> | - --------------------- - - -### setOnMarkerDragListener(...) - -```typescript -setOnMarkerDragListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<MarkerClickCallbackData> | - --------------------- - - -### setOnMarkerDragEndListener(...) - -```typescript -setOnMarkerDragEndListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<MarkerClickCallbackData> | - --------------------- - - -### setOnMyLocationButtonClickListener(...) - -```typescript -setOnMyLocationButtonClickListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<MyLocationButtonClickCallbackData> | - --------------------- - - -### setOnMyLocationClickListener(...) - -```typescript -setOnMyLocationClickListener(callback?: MapListenerCallback | undefined) => Promise -``` - -| Param | Type | -| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| **`callback`** | MapListenerCallback<MapClickCallbackData> | - --------------------- - - -### Interfaces - - -#### CreateMapArgs - -An interface containing the options used when creating a map. - -| Prop | Type | Description | Default | -| ----------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -| **`id`** | string | A unique identifier for the map instance. | | -| **`apiKey`** | string | The Google Maps SDK API Key. | | -| **`config`** | GoogleMapConfig | The initial configuration settings for the map. | | -| **`element`** | HTMLElement | The DOM element that the Google Map View will be mounted on which determines size and positioning. | | -| **`forceCreate`** | boolean | Destroy and re-create the map instance if a map with the supplied id already exists | false | -| **`region`** | string | The region parameter alters your application to serve different map tiles or bias the application (such as biasing geocoding results towards the region). Only available for web. | | -| **`language`** | string | The language parameter affects the names of controls, copyright notices, driving directions, and control labels, as well as the responses to service requests. Only available for web. | | - - -#### GoogleMapConfig - -For web, all the javascript Google Maps options are available as -GoogleMapConfig extends google.maps.MapOptions. -For iOS and Android only the config options declared on GoogleMapConfig are available. - -| Prop | Type | Description | Default | Since | -| ---------------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- | -| **`width`** | number | Override width for native map. | | | -| **`height`** | number | Override height for native map. | | | -| **`x`** | number | Override absolute x coordinate position for native map. | | | -| **`y`** | number | Override absolute y coordinate position for native map. | | | -| **`center`** | LatLng | Default location on the Earth towards which the camera points. | | | -| **`zoom`** | number | Sets the zoom of the map. | | | -| **`androidLiteMode`** | boolean | Enables image-based lite mode on Android. | false | | -| **`devicePixelRatio`** | number | Override pixel ratio for native map. | | | -| **`styles`** | MapTypeStyle[] \| null | Styles to apply to each of the default map types. Note that for satellite, hybrid and terrain modes, these styles will only apply to labels and geometry. | | 4.3.0 | -| **`mapId`** | string | A map id associated with a specific map style or feature. [Use Map IDs](https://developers.google.com/maps/documentation/get-map-id) Only for Web. | | 5.4.0 | -| **`androidMapId`** | string | A map id associated with a specific map style or feature. [Use Map IDs](https://developers.google.com/maps/documentation/get-map-id) Only for Android. | | 5.4.0 | -| **`iOSMapId`** | string | A map id associated with a specific map style or feature. [Use Map IDs](https://developers.google.com/maps/documentation/get-map-id) Only for iOS. | | 5.4.0 | - - -#### LatLng - -An interface representing a pair of latitude and longitude coordinates. - -| Prop | Type | Description | -| --------- | ------------------- | ------------------------------------------------------------------------- | -| **`lat`** | number | Coordinate latitude, in degrees. This value is in the range [-90, 90]. | -| **`lng`** | number | Coordinate longitude, in degrees. This value is in the range [-180, 180]. | - - -#### MapReadyCallbackData - -| Prop | Type | -| ----------- | ------------------- | -| **`mapId`** | string | - - -#### Marker - -A marker is an icon placed at a particular point on the map's surface. - -| Prop | Type | Description | Default | Since | -| ---------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- | -| **`coordinate`** | LatLng | Marker position | | | -| **`opacity`** | number | Sets the opacity of the marker, between 0 (completely transparent) and 1 inclusive. | 1 | | -| **`title`** | string | Title, a short description of the overlay. | | | -| **`snippet`** | string | Snippet text, shown beneath the title in the info window when selected. | | | -| **`isFlat`** | boolean | Controls whether this marker should be flat against the Earth's surface or a billboard facing the camera. | false | | -| **`iconUrl`** | string | Path to a marker icon to render. It can be relative to the web app public directory, or a https url of a remote marker icon. **SVGs are not supported on native platforms.** | | 4.2.0 | -| **`iconSize`** | Size | Controls the scaled size of the marker image set in `iconUrl`. | | 4.2.0 | -| **`iconOrigin`** | Point | The position of the image within a sprite, if any. By default, the origin is located at the top left corner of the image . | | 4.2.0 | -| **`iconAnchor`** | Point | The position at which to anchor an image in correspondence to the location of the marker on the map. By default, the anchor is located along the center point of the bottom of the image. | | 4.2.0 | -| **`tintColor`** | { r: number; g: number; b: number; a: number; } | Customizes the color of the default marker image. Each value must be between 0 and 255. Only for iOS and Android. | | 4.2.0 | -| **`draggable`** | boolean | Controls whether this marker can be dragged interactively | false | | -| **`zIndex`** | number | Specifies the stack order of this marker, relative to other markers on the map. A marker with a high z-index is drawn on top of markers with lower z-indexes | 0 | | - - -#### Size - -| Prop | Type | -| ------------ | ------------------- | -| **`width`** | number | -| **`height`** | number | - - -#### Point - -Point geometry object. -https://tools.ietf.org/html/rfc7946#section-3.1.2 - -| Prop | Type | Description | -| ----------------- | --------------------------------------------- | ------------------------------------- | -| **`type`** | 'Point' | Specifies the type of GeoJSON object. | -| **`coordinates`** | Position | | - - -#### Polygon - -Polygon geometry object. -https://tools.ietf.org/html/rfc7946#section-3.1.6 - -| Prop | Type | Description | -| ----------------- | --------------------------------------------- | ------------------------------------- | -| **`type`** | 'Polygon' | Specifies the type of GeoJSON object. | -| **`coordinates`** | Position[][] | | - - -#### Circle - -For web, all the javascript Circle options are available as -Polygon extends google.maps.CircleOptions. -For iOS and Android only the config options declared on Circle are available. - -| Prop | Type | Description | -| ------------------ | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`fillColor`** | string | The fill color. All CSS3 colors are supported except for extended named colors. | -| **`fillOpacity`** | number | The fill opacity between 0.0 and 1.0. | -| **`strokeColor`** | string | The stroke color. All CSS3 colors are supported except for extended named colors. | -| **`strokeWeight`** | number | The stroke width in pixels. | -| **`geodesic`** | boolean | | -| **`clickable`** | boolean | Indicates whether this <code>Circle</code> handles mouse events. | -| **`title`** | string | Title, a short description of the overlay. Some overlays, such as markers, will display the title on the map. The title is also the default accessibility text. Only available on iOS. | -| **`tag`** | string | | - - -#### Polyline - -For web, all the javascript Polyline options are available as -Polyline extends google.maps.PolylineOptions. -For iOS and Android only the config options declared on Polyline are available. - -| Prop | Type | Description | -| ------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`strokeColor`** | string | The stroke color. All CSS3 colors are supported except for extended named colors. | -| **`strokeOpacity`** | number | The stroke opacity between 0.0 and 1.0. | -| **`strokeWeight`** | number | The stroke width in pixels. | -| **`geodesic`** | boolean | When <code>true</code>, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth. When <code>false</code>, edges of the polygon are rendered as straight lines in screen space. Note that the shape of a geodesic polygon may appear to change when dragged, as the dimensions are maintained relative to the surface of the earth. | -| **`clickable`** | boolean | Indicates whether this <code>Polyline</code> handles mouse events. | -| **`tag`** | string | | -| **`styleSpans`** | StyleSpan[] | Used to specify the color of one or more segments of a polyline. The styleSpans property is an array of StyleSpan objects. Setting the spans property is the preferred way to change the color of a polyline. Only on iOS and Android. | - - -#### StyleSpan - -Describes the style for some region of a polyline. - -| Prop | Type | Description | -| -------------- | ------------------- | --------------------------------------------------------------------------------- | -| **`color`** | string | The stroke color. All CSS3 colors are supported except for extended named colors. | -| **`segments`** | number | The length of this span in number of segments. | - - -#### CameraConfig - -Configuration properties for a Google Map Camera - -| Prop | Type | Description | Default | -| ----------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------ | -| **`coordinate`** | LatLng | Location on the Earth towards which the camera points. | | -| **`zoom`** | number | Sets the zoom of the map. | | -| **`bearing`** | number | Bearing of the camera, in degrees clockwise from true north. | 0 | -| **`angle`** | number | The angle, in degrees, of the camera from the nadir (directly facing the Earth). The only allowed values are 0 and 45. | 0 | -| **`animate`** | boolean | Animate the transition to the new Camera properties. | false | -| **`animationDuration`** | number | This configuration option is not being used. | | - - -#### MapPadding - -Controls for setting padding on the 'visible' region of the view. - -| Prop | Type | -| ------------ | ------------------- | -| **`top`** | number | -| **`left`** | number | -| **`right`** | number | -| **`bottom`** | number | - - -#### CameraIdleCallbackData - -| Prop | Type | -| --------------- | ------------------------- | -| **`mapId`** | string | -| **`bounds`** | LatLngBounds | -| **`bearing`** | number | -| **`latitude`** | number | -| **`longitude`** | number | -| **`tilt`** | number | -| **`zoom`** | number | - - -#### CameraMoveStartedCallbackData - -| Prop | Type | -| --------------- | -------------------- | -| **`mapId`** | string | -| **`isGesture`** | boolean | - - -#### ClusterClickCallbackData - -| Prop | Type | -| --------------- | --------------------------------- | -| **`mapId`** | string | -| **`latitude`** | number | -| **`longitude`** | number | -| **`size`** | number | -| **`items`** | MarkerCallbackData[] | - - -#### MarkerCallbackData - -| Prop | Type | -| --------------- | ------------------- | -| **`markerId`** | string | -| **`latitude`** | number | -| **`longitude`** | number | -| **`title`** | string | -| **`snippet`** | string | - - -#### MarkerClickCallbackData - -| Prop | Type | -| ----------- | ------------------- | -| **`mapId`** | string | - - -#### MapClickCallbackData - -| Prop | Type | -| --------------- | ------------------- | -| **`mapId`** | string | -| **`latitude`** | number | -| **`longitude`** | number | - - -#### PolygonClickCallbackData - -| Prop | Type | -| --------------- | ------------------- | -| **`mapId`** | string | -| **`polygonId`** | string | -| **`tag`** | string | - - -#### CircleClickCallbackData - -| Prop | Type | -| -------------- | ------------------- | -| **`mapId`** | string | -| **`circleId`** | string | -| **`tag`** | string | - - -#### PolylineCallbackData - -| Prop | Type | -| ---------------- | ------------------- | -| **`polylineId`** | string | -| **`tag`** | string | - - -#### MyLocationButtonClickCallbackData - -| Prop | Type | -| ----------- | ------------------- | -| **`mapId`** | string | - - -### Type Aliases - - -#### MapListenerCallback - -The callback function to be called when map events are emitted. - -(data: T): void - - -#### Position - -A Position is an array of coordinates. -https://tools.ietf.org/html/rfc7946#section-3.1.1 -Array should contain between two and three elements. -The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), -but the current specification only allows X, Y, and (optionally) Z to be defined. - -number[] - - -### Enums - - -#### MapType - -| Members | Value | Description | -| --------------- | ------------------------ | ---------------------------------------- | -| **`Normal`** | 'Normal' | Basic map. | -| **`Hybrid`** | 'Hybrid' | Satellite imagery with roads and labels. | -| **`Satellite`** | 'Satellite' | Satellite imagery with no labels. | -| **`Terrain`** | 'Terrain' | Topographic data. | -| **`None`** | 'None' | No base map tiles. | - - diff --git a/google-maps/android/.gitignore b/google-maps/android/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/google-maps/android/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/google-maps/android/build.gradle b/google-maps/android/build.gradle deleted file mode 100644 index 056e5af3d..000000000 --- a/google-maps/android/build.gradle +++ /dev/null @@ -1,99 +0,0 @@ -ext { - capacitorVersion = System.getenv('CAPACITOR_VERSION') - junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' - androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' - androidxCoreKTXVersion = project.hasProperty('androidxCoreKTXVersion') ? rootProject.ext.androidxCoreKTXVersion : '1.12.0' - googleMapsPlayServicesVersion = project.hasProperty('googleMapsPlayServicesVersion') ? rootProject.ext.googleMapsPlayServicesVersion : '18.2.0' - googleMapsUtilsVersion = project.hasProperty('googleMapsUtilsVersion') ? rootProject.ext.googleMapsUtilsVersion : '3.8.2' - googleMapsKtxVersion = project.hasProperty('googleMapsKtxVersion') ? rootProject.ext.googleMapsKtxVersion : '5.0.0' - googleMapsUtilsKtxVersion = project.hasProperty('googleMapsUtilsKtxVersion') ? rootProject.ext.googleMapsUtilsKtxVersion : '5.0.0' - kotlinxCoroutinesVersion = project.hasProperty('kotlinxCoroutinesVersion') ? rootProject.ext.kotlinxCoroutinesVersion : '1.7.3' -} - -buildscript { - ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.9.10' - repositories { - google() - mavenCentral() - maven { - url "https://plugins.gradle.org/m2/" - } - } - dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { - classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' - } - } -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { - apply plugin: 'io.github.gradle-nexus.publish-plugin' - apply from: file('../../scripts/android/publish-root.gradle') - apply from: file('../../scripts/android/publish-module.gradle') -} - -android { - namespace "com.capacitorjs.plugins.googlemaps" - compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34 - defaultConfig { - minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22 - targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - lintOptions { - abortOnError false - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - publishing { - singleVariant("release") - } - dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinxCoroutinesVersion") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion") - } -} - -repositories { - google() - mavenCentral() -} - - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - - if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { - implementation "com.capacitorjs:core:$capacitorVersion" - } else { - implementation project(':capacitor-android') - } - - implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" - testImplementation "junit:junit:$junitVersion" - androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" - androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" - implementation "androidx.core:core-ktx:$androidxCoreKTXVersion" - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - - implementation "com.google.maps.android:maps-ktx:$googleMapsKtxVersion" - implementation "com.google.maps.android:maps-utils-ktx:$googleMapsUtilsKtxVersion" - implementation "com.google.maps.android:android-maps-utils:$googleMapsUtilsVersion" - implementation "com.google.android.gms:play-services-maps:$googleMapsPlayServicesVersion" -} diff --git a/google-maps/android/gradle.properties b/google-maps/android/gradle.properties deleted file mode 100644 index aa7ea2584..000000000 --- a/google-maps/android/gradle.properties +++ /dev/null @@ -1,22 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=2g - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -# AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app's APK -# https://developer.android.com/topic/libraries/support-library/androidx-rn -android.useAndroidX=true diff --git a/google-maps/android/gradle/wrapper/gradle-wrapper.jar b/google-maps/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 033e24c4c..000000000 Binary files a/google-maps/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/google-maps/android/gradle/wrapper/gradle-wrapper.properties b/google-maps/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index c747538fb..000000000 --- a/google-maps/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/google-maps/android/gradlew b/google-maps/android/gradlew deleted file mode 100755 index fcb6fca14..000000000 --- a/google-maps/android/gradlew +++ /dev/null @@ -1,248 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/google-maps/android/gradlew.bat b/google-maps/android/gradlew.bat deleted file mode 100644 index 6689b85be..000000000 --- a/google-maps/android/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/google-maps/android/proguard-rules.pro b/google-maps/android/proguard-rules.pro deleted file mode 100644 index f1b424510..000000000 --- a/google-maps/android/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/google-maps/android/settings.gradle b/google-maps/android/settings.gradle deleted file mode 100644 index 1e5b8431f..000000000 --- a/google-maps/android/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -include ':capacitor-android' -project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') \ No newline at end of file diff --git a/google-maps/android/src/main/AndroidManifest.xml b/google-maps/android/src/main/AndroidManifest.xml deleted file mode 100644 index a2f47b605..000000000 --- a/google-maps/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorClusterManagerRenderer.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorClusterManagerRenderer.kt deleted file mode 100644 index 990e83b4f..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorClusterManagerRenderer.kt +++ /dev/null @@ -1,37 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import android.content.Context -import com.google.android.gms.maps.GoogleMap -import com.google.android.gms.maps.model.MarkerOptions -import com.google.maps.android.clustering.ClusterManager -import com.google.maps.android.clustering.view.DefaultClusterRenderer - -class CapacitorClusterManagerRenderer( - context: Context, - map: GoogleMap?, - clusterManager: ClusterManager?, - minClusterSize: Int? -) : DefaultClusterRenderer(context, map, clusterManager) { - - init { - if(minClusterSize != null && minClusterSize > 0) { - super.setMinClusterSize(minClusterSize) - } - } - - override fun onBeforeClusterItemRendered(item: CapacitorGoogleMapMarker, markerOptions: MarkerOptions) { - super.onBeforeClusterItemRendered(item, markerOptions) - - item.markerOptions?.let { - markerOptions.position(it.position) - markerOptions.title(it.title) - markerOptions.snippet(it.snippet) - markerOptions.alpha(it.alpha) - markerOptions.flat(it.isFlat) - markerOptions.draggable(it.isDraggable) - if(null != it.icon) { - markerOptions.icon(it.icon) - } - } - } -} diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMap.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMap.kt deleted file mode 100644 index a22aa2208..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMap.kt +++ /dev/null @@ -1,1099 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import android.annotation.SuppressLint -import android.graphics.* -import android.location.Location -import android.util.Log -import android.view.MotionEvent -import android.view.View -import android.view.ViewGroup -import android.widget.FrameLayout -import com.getcapacitor.Bridge -import com.getcapacitor.JSArray -import com.getcapacitor.JSObject -import com.google.android.gms.maps.* -import com.google.android.gms.maps.GoogleMap.* -import com.google.android.gms.maps.model.* -import com.google.maps.android.clustering.Cluster -import com.google.maps.android.clustering.ClusterManager -import kotlinx.coroutines.* -import kotlinx.coroutines.channels.Channel -import java.io.InputStream -import java.net.URL - - -class CapacitorGoogleMap( - val id: String, - val config: GoogleMapConfig, - val delegate: CapacitorGoogleMapsPlugin -) : - OnCameraIdleListener, - OnCameraMoveStartedListener, - OnCameraMoveListener, - OnMyLocationButtonClickListener, - OnMyLocationClickListener, - OnMapReadyCallback, - OnMapClickListener, - OnMarkerClickListener, - OnMarkerDragListener, - OnInfoWindowClickListener, - OnCircleClickListener, - OnPolylineClickListener, - OnPolygonClickListener { - private var mapView: MapView - private var googleMap: GoogleMap? = null - private val markers = HashMap() - private val polygons = HashMap() - private val circles = HashMap() - private val polylines = HashMap() - private val markerIcons = HashMap() - private var clusterManager: ClusterManager? = null - - private val isReadyChannel = Channel() - private var debounceJob: Job? = null - - init { - val bridge = delegate.bridge - - mapView = MapView(bridge.context, config.googleMapOptions) - initMap() - setListeners() - } - - private fun initMap() { - runBlocking { - val job = - CoroutineScope(Dispatchers.Main).launch { - mapView.onCreate(null) - mapView.onStart() - mapView.getMapAsync(this@CapacitorGoogleMap) - mapView.setWillNotDraw(false) - isReadyChannel.receive() - - render() - } - - job.join() - } - } - - private fun render() { - runBlocking { - CoroutineScope(Dispatchers.Main).launch { - val bridge = delegate.bridge - val mapViewParent = FrameLayout(bridge.context) - mapViewParent.minimumHeight = bridge.webView.height - mapViewParent.minimumWidth = bridge.webView.width - - val layoutParams = - FrameLayout.LayoutParams( - getScaledPixels(bridge, config.width), - getScaledPixels(bridge, config.height), - ) - layoutParams.leftMargin = getScaledPixels(bridge, config.x) - layoutParams.topMargin = getScaledPixels(bridge, config.y) - - mapViewParent.tag = id - - mapView.layoutParams = layoutParams - mapViewParent.addView(mapView) - - ((bridge.webView.parent) as ViewGroup).addView(mapViewParent) - - bridge.webView.bringToFront() - bridge.webView.setBackgroundColor(Color.TRANSPARENT) - if (config.styles != null) { - googleMap?.setMapStyle(MapStyleOptions(config.styles!!)) - } - } - } - } - - fun updateRender(updatedBounds: RectF) { - this.config.x = updatedBounds.left.toInt() - this.config.y = updatedBounds.top.toInt() - this.config.width = updatedBounds.width().toInt() - this.config.height = updatedBounds.height().toInt() - - runBlocking { - CoroutineScope(Dispatchers.Main).launch { - val bridge = delegate.bridge - val mapRect = getScaledRect(bridge, updatedBounds) - val mapView = this@CapacitorGoogleMap.mapView; - mapView.x = mapRect.left - mapView.y = mapRect.top - if (mapView.layoutParams.width != config.width || mapView.layoutParams.height != config.height) { - mapView.layoutParams.width = getScaledPixels(bridge, config.width) - mapView.layoutParams.height = getScaledPixels(bridge, config.height) - mapView.requestLayout() - } - } - } - } - - fun dispatchTouchEvent(event: MotionEvent) { - CoroutineScope(Dispatchers.Main).launch { - val offsetViewBounds = getMapBounds() - - val relativeTop = offsetViewBounds.top - val relativeLeft = offsetViewBounds.left - - event.setLocation(event.x - relativeLeft, event.y - relativeTop) - mapView.dispatchTouchEvent(event) - } - } - - fun bringToFront() { - CoroutineScope(Dispatchers.Main).launch { - val mapViewParent = - ((delegate.bridge.webView.parent) as ViewGroup).findViewWithTag( - this@CapacitorGoogleMap.id - ) - mapViewParent.bringToFront() - } - } - - fun destroy() { - runBlocking { - val job = - CoroutineScope(Dispatchers.Main).launch { - val bridge = delegate.bridge - - val viewToRemove: View? = - ((bridge.webView.parent) as ViewGroup).findViewWithTag(id) - if (null != viewToRemove) { - ((bridge.webView.parent) as ViewGroup).removeView(viewToRemove) - } - mapView.onDestroy() - googleMap = null - clusterManager = null - } - - job.join() - } - } - - fun addMarkers( - newMarkers: List, - callback: (ids: Result>) -> Unit - ) { - try { - googleMap ?: throw GoogleMapNotAvailable() - val markerIds: MutableList = mutableListOf() - - CoroutineScope(Dispatchers.Main).launch { - newMarkers.forEach { - val markerOptions: Deferred = - CoroutineScope(Dispatchers.IO).async { - this@CapacitorGoogleMap.buildMarker(it) - } - val googleMapMarker = googleMap?.addMarker(markerOptions.await()) - it.googleMapMarker = googleMapMarker - - if (googleMapMarker != null) { - if (clusterManager != null) { - googleMapMarker.remove() - } - - markers[googleMapMarker.id] = it - markerIds.add(googleMapMarker.id) - } - } - - if (clusterManager != null) { - clusterManager?.addItems(newMarkers) - clusterManager?.cluster() - } - - callback(Result.success(markerIds)) - } - } catch (e: GoogleMapsError) { - callback(Result.failure(e)) - } - } - - fun addMarker(marker: CapacitorGoogleMapMarker, callback: (result: Result) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - - var markerId: String - - CoroutineScope(Dispatchers.Main).launch { - val markerOptions: Deferred = - CoroutineScope(Dispatchers.IO).async { - this@CapacitorGoogleMap.buildMarker(marker) - } - val googleMapMarker = googleMap?.addMarker(markerOptions.await()) - - marker.googleMapMarker = googleMapMarker - - if (clusterManager != null) { - googleMapMarker?.remove() - clusterManager?.addItem(marker) - clusterManager?.cluster() - } - - markers[googleMapMarker!!.id] = marker - - markerId = googleMapMarker.id - - callback(Result.success(markerId)) - } - } catch (e: GoogleMapsError) { - callback(Result.failure(e)) - } - } - - fun addPolygons(newPolygons: List, callback: (ids: Result>) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - val shapeIds: MutableList = mutableListOf() - - CoroutineScope(Dispatchers.Main).launch { - newPolygons.forEach { - val polygonOptions: Deferred = CoroutineScope(Dispatchers.IO).async { - this@CapacitorGoogleMap.buildPolygon(it) - } - - val googleMapsPolygon = googleMap?.addPolygon(polygonOptions.await()) - googleMapsPolygon?.tag = it.tag - - it.googleMapsPolygon = googleMapsPolygon - - polygons[googleMapsPolygon!!.id] = it - shapeIds.add(googleMapsPolygon.id) - } - - callback(Result.success(shapeIds)) - } - } catch (e: GoogleMapsError) { - callback(Result.failure(e)) - } - } - - fun addCircles(newCircles: List,callback: (ids: Result>) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - val circleIds: MutableList = mutableListOf() - - CoroutineScope(Dispatchers.Main).launch { - newCircles.forEach { - var circleOptions: Deferred = CoroutineScope(Dispatchers.IO).async { - this@CapacitorGoogleMap.buildCircle(it) - } - - val googleMapsCircle = googleMap?.addCircle(circleOptions.await()) - googleMapsCircle?.tag = it.tag - - it.googleMapsCircle = googleMapsCircle - - circles[googleMapsCircle!!.id] = it - circleIds.add(googleMapsCircle.id) - } - - callback(Result.success(circleIds)) - } - } catch (e: GoogleMapsError) { - callback(Result.failure(e)) - } - } - - fun addPolylines(newLines: List, callback: (ids: Result>) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - val lineIds: MutableList = mutableListOf() - - CoroutineScope(Dispatchers.Main).launch { - newLines.forEach { - val polylineOptions: Deferred = CoroutineScope(Dispatchers.IO).async { - this@CapacitorGoogleMap.buildPolyline(it) - } - val googleMapPolyline = googleMap?.addPolyline(polylineOptions.await()) - googleMapPolyline?.tag = it.tag - - it.googleMapsPolyline = googleMapPolyline - - polylines[googleMapPolyline!!.id] = it - lineIds.add(googleMapPolyline.id) - } - - callback(Result.success(lineIds)) - } - } catch (e: GoogleMapsError) { - callback(Result.failure(e)) - } - } - - private fun setClusterManagerRenderer(minClusterSize: Int?) { - clusterManager?.renderer = CapacitorClusterManagerRenderer( - delegate.bridge.context, - googleMap, - clusterManager, - minClusterSize - ) - } - - @SuppressLint("PotentialBehaviorOverride") - fun enableClustering(minClusterSize: Int?, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - - CoroutineScope(Dispatchers.Main).launch { - if (clusterManager != null) { - setClusterManagerRenderer(minClusterSize) - callback(null) - return@launch - } - - val bridge = delegate.bridge - clusterManager = ClusterManager(bridge.context, googleMap) - - setClusterManagerRenderer(minClusterSize) - setClusterListeners() - - // add existing markers to the cluster - if (markers.isNotEmpty()) { - for ((_, marker) in markers) { - marker.googleMapMarker?.remove() - // marker.googleMapMarker = null - } - clusterManager?.addItems(markers.values) - clusterManager?.cluster() - } - - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - @SuppressLint("PotentialBehaviorOverride") - fun disableClustering(callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - - CoroutineScope(Dispatchers.Main).launch { - clusterManager?.clearItems() - clusterManager?.cluster() - clusterManager = null - - googleMap?.setOnMarkerClickListener(this@CapacitorGoogleMap) - - // add existing markers back to the map - if (markers.isNotEmpty()) { - for ((_, marker) in markers) { - val markerOptions: Deferred = - CoroutineScope(Dispatchers.IO).async { - this@CapacitorGoogleMap.buildMarker(marker) - } - val googleMapMarker = googleMap?.addMarker(markerOptions.await()) - marker.googleMapMarker = googleMapMarker - } - } - - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun removePolygons(ids: List, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - - CoroutineScope(Dispatchers.Main).launch { - ids.forEach { - val polygon = polygons[it] - if (polygon != null) { - polygon.googleMapsPolygon?.remove() - polygons.remove(it) - } - } - - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun removeMarker(id: String, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - - val marker = markers[id] - marker ?: throw MarkerNotFoundError() - - CoroutineScope(Dispatchers.Main).launch { - if (clusterManager != null) { - clusterManager?.removeItem(marker) - clusterManager?.cluster() - } - - marker.googleMapMarker?.remove() - markers.remove(id) - - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun removeMarkers(ids: List, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - - CoroutineScope(Dispatchers.Main).launch { - val deletedMarkers: MutableList = mutableListOf() - - ids.forEach { - val marker = markers[it] - if (marker != null) { - marker.googleMapMarker?.remove() - markers.remove(it) - - deletedMarkers.add(marker) - } - } - - if (clusterManager != null) { - clusterManager?.removeItems(deletedMarkers) - clusterManager?.cluster() - } - - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun removeCircles(ids: List, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - - CoroutineScope(Dispatchers.Main).launch { - ids.forEach { - val circle = circles[it] - if (circle != null) { - circle.googleMapsCircle?.remove() - markers.remove(it) - } - } - - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun removePolylines(ids: List, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - - CoroutineScope(Dispatchers.Main).launch { - ids.forEach { - val polyline = polylines[it] - if (polyline != null) { - polyline.googleMapsPolyline?.remove() - polylines.remove(it) - } - } - - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun setCamera(config: GoogleMapCameraConfig, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - CoroutineScope(Dispatchers.Main).launch { - val currentPosition = googleMap!!.cameraPosition - - var updatedTarget = config.coordinate - if (updatedTarget == null) { - updatedTarget = currentPosition.target - } - - var zoom = config.zoom - if (zoom == null) { - zoom = currentPosition.zoom.toDouble() - } - - var bearing = config.bearing - if (bearing == null) { - bearing = currentPosition.bearing.toDouble() - } - - var angle = config.angle - if (angle == null) { - angle = currentPosition.tilt.toDouble() - } - - var animate = config.animate - if (animate == null) { - animate = false - } - - val updatedPosition = - CameraPosition.Builder() - .target(updatedTarget) - .zoom(zoom.toFloat()) - .bearing(bearing.toFloat()) - .tilt(angle.toFloat()) - .build() - - if (animate) { - googleMap?.animateCamera(CameraUpdateFactory.newCameraPosition(updatedPosition)) - } else { - googleMap?.moveCamera(CameraUpdateFactory.newCameraPosition(updatedPosition)) - } - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun getMapType(callback: (type: String, error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - CoroutineScope(Dispatchers.Main).launch { - val mapType: String = when (googleMap?.mapType) { - MAP_TYPE_NORMAL -> "Normal" - MAP_TYPE_HYBRID -> "Hybrid" - MAP_TYPE_SATELLITE -> "Satellite" - MAP_TYPE_TERRAIN -> "Terrain" - MAP_TYPE_NONE -> "None" - else -> { - "Normal" - } - } - callback(mapType, null); - } - } catch (e: GoogleMapsError) { - callback("", e) - } - } - - fun setMapType(mapType: String, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - CoroutineScope(Dispatchers.Main).launch { - val mapTypeInt: Int = - when (mapType) { - "Normal" -> MAP_TYPE_NORMAL - "Hybrid" -> MAP_TYPE_HYBRID - "Satellite" -> MAP_TYPE_SATELLITE - "Terrain" -> MAP_TYPE_TERRAIN - "None" -> MAP_TYPE_NONE - else -> { - Log.w( - "CapacitorGoogleMaps", - "unknown mapView type '$mapType' Defaulting to normal." - ) - MAP_TYPE_NORMAL - } - } - - googleMap?.mapType = mapTypeInt - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun enableIndoorMaps(enabled: Boolean, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - CoroutineScope(Dispatchers.Main).launch { - googleMap?.isIndoorEnabled = enabled - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun enableTrafficLayer(enabled: Boolean, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - CoroutineScope(Dispatchers.Main).launch { - googleMap?.isTrafficEnabled = enabled - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - @SuppressLint("MissingPermission") - fun enableCurrentLocation(enabled: Boolean, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - CoroutineScope(Dispatchers.Main).launch { - googleMap?.isMyLocationEnabled = enabled - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun setPadding(padding: GoogleMapPadding, callback: (error: GoogleMapsError?) -> Unit) { - try { - googleMap ?: throw GoogleMapNotAvailable() - CoroutineScope(Dispatchers.Main).launch { - googleMap?.setPadding(padding.left, padding.top, padding.right, padding.bottom) - callback(null) - } - } catch (e: GoogleMapsError) { - callback(e) - } - } - - fun getMapBounds(): Rect { - return Rect( - getScaledPixels(delegate.bridge, config.x), - getScaledPixels(delegate.bridge, config.y), - getScaledPixels(delegate.bridge, config.x + config.width), - getScaledPixels(delegate.bridge, config.y + config.height) - ) - } - - fun getLatLngBounds(): LatLngBounds { - return googleMap?.projection?.visibleRegion?.latLngBounds ?: throw BoundsNotFoundError() - } - - fun fitBounds(bounds: LatLngBounds, padding: Int) { - val cameraUpdate = CameraUpdateFactory.newLatLngBounds(bounds, padding) - googleMap?.animateCamera(cameraUpdate) - } - - private fun getScaledPixels(bridge: Bridge, pixels: Int): Int { - // Get the screen's density scale - val scale = bridge.activity.resources.displayMetrics.density - // Convert the dps to pixels, based on density scale - return (pixels * scale + 0.5f).toInt() - } - - private fun getScaledPixelsF(bridge: Bridge, pixels: Float): Float { - // Get the screen's density scale - val scale = bridge.activity.resources.displayMetrics.density - // Convert the dps to pixels, based on density scale - return (pixels * scale + 0.5f) - } - - private fun getScaledRect(bridge: Bridge, rectF: RectF): RectF { - return RectF( - getScaledPixelsF(bridge, rectF.left), - getScaledPixelsF(bridge, rectF.top), - getScaledPixelsF(bridge, rectF.right), - getScaledPixelsF(bridge, rectF.bottom) - ) - } - - private fun buildCircle(circle: CapacitorGoogleMapsCircle): CircleOptions { - val circleOptions = CircleOptions() - circleOptions.fillColor(circle.fillColor) - circleOptions.strokeColor(circle.strokeColor) - circleOptions.strokeWidth(circle.strokeWidth) - circleOptions.zIndex(circle.zIndex) - circleOptions.clickable(circle.clickable) - circleOptions.radius(circle.radius.toDouble()) - circleOptions.center(circle.center) - - return circleOptions - } - - private fun buildPolygon(polygon: CapacitorGoogleMapsPolygon): PolygonOptions { - val polygonOptions = PolygonOptions() - polygonOptions.fillColor(polygon.fillColor) - polygonOptions.strokeColor(polygon.strokeColor) - polygonOptions.strokeWidth(polygon.strokeWidth) - polygonOptions.zIndex(polygon.zIndex) - polygonOptions.geodesic(polygon.geodesic) - polygonOptions.clickable(polygon.clickable) - - var shapeCounter = 0 - polygon.shapes.forEach { - if (shapeCounter == 0) { - // outer shape - it.forEach { - polygonOptions.add(it) - } - } else { - polygonOptions.addHole(it) - } - - shapeCounter += 1 - } - - return polygonOptions - } - - private fun buildPolyline(line: CapacitorGoogleMapPolyline): PolylineOptions { - val polylineOptions = PolylineOptions() - polylineOptions.width(line.strokeWidth * this.config.devicePixelRatio) - polylineOptions.color(line.strokeColor) - polylineOptions.clickable(line.clickable) - polylineOptions.zIndex(line.zIndex) - polylineOptions.geodesic(line.geodesic) - - line.path.forEach { - polylineOptions.add(it) - } - - line.styleSpans.forEach { - if (it.segments != null) { - polylineOptions.addSpan(StyleSpan(it.color, it.segments)) - } else { - polylineOptions.addSpan(StyleSpan(it.color)) - } - } - - return polylineOptions - } - - private fun buildMarker(marker: CapacitorGoogleMapMarker): MarkerOptions { - val markerOptions = MarkerOptions() - markerOptions.position(marker.coordinate) - markerOptions.title(marker.title) - markerOptions.snippet(marker.snippet) - markerOptions.alpha(marker.opacity) - markerOptions.flat(marker.isFlat) - markerOptions.draggable(marker.draggable) - markerOptions.zIndex(marker.zIndex) - if (marker.iconAnchor != null) { - markerOptions.anchor(marker.iconAnchor!!.x, marker.iconAnchor!!.y) - } - - - if (!marker.iconUrl.isNullOrEmpty()) { - if (this.markerIcons.contains(marker.iconUrl)) { - val cachedBitmap = this.markerIcons[marker.iconUrl] - markerOptions.icon(getResizedIcon(cachedBitmap!!, marker)) - } else { - try { - var stream: InputStream? = null - if (marker.iconUrl!!.startsWith("https:")) { - stream = URL(marker.iconUrl).openConnection().getInputStream() - } else { - stream = this.delegate.context.assets.open("public/${marker.iconUrl}") - } - var bitmap = BitmapFactory.decodeStream(stream) - this.markerIcons[marker.iconUrl!!] = bitmap - markerOptions.icon(getResizedIcon(bitmap, marker)) - } catch (e: Exception) { - var detailedMessage = "${e.javaClass} - ${e.localizedMessage}" - if (marker.iconUrl!!.endsWith(".svg")) { - detailedMessage = "SVG not supported" - } - - Log.w( - "CapacitorGoogleMaps", - "Could not load image '${marker.iconUrl}': ${detailedMessage}. Using default marker icon." - ) - } - } - } else { - if (marker.colorHue != null) { - markerOptions.icon(BitmapDescriptorFactory.defaultMarker(marker.colorHue!!)) - } - } - - marker.markerOptions = markerOptions - - return markerOptions - } - - private fun getResizedIcon( - _bitmap: Bitmap, - marker: CapacitorGoogleMapMarker - ): BitmapDescriptor { - var bitmap = _bitmap - if (marker.iconSize != null) { - bitmap = - Bitmap.createScaledBitmap( - bitmap, - (marker.iconSize!!.width * this.config.devicePixelRatio).toInt(), - (marker.iconSize!!.height * this.config.devicePixelRatio).toInt(), - false - ) - } - return BitmapDescriptorFactory.fromBitmap(bitmap) - } - - fun onStart() { - mapView.onStart() - } - - fun onResume() { - mapView.onResume() - } - - fun onStop() { - mapView.onStop() - } - - fun onPause() { - mapView.onPause() - } - - fun onDestroy() { - mapView.onDestroy() - } - - override fun onMapReady(map: GoogleMap) { - runBlocking { - googleMap = map - - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - delegate.notify("onMapReady", data) - - isReadyChannel.send(true) - isReadyChannel.close() - } - } - - @SuppressLint("PotentialBehaviorOverride") - fun setListeners() { - CoroutineScope(Dispatchers.Main).launch { - this@CapacitorGoogleMap.googleMap?.setOnCameraIdleListener(this@CapacitorGoogleMap) - this@CapacitorGoogleMap.googleMap?.setOnCameraMoveStartedListener( - this@CapacitorGoogleMap - ) - this@CapacitorGoogleMap.googleMap?.setOnCameraMoveListener(this@CapacitorGoogleMap) - this@CapacitorGoogleMap.googleMap?.setOnMarkerClickListener(this@CapacitorGoogleMap) - this@CapacitorGoogleMap.googleMap?.setOnPolygonClickListener(this@CapacitorGoogleMap) - this@CapacitorGoogleMap.googleMap?.setOnCircleClickListener(this@CapacitorGoogleMap) - this@CapacitorGoogleMap.googleMap?.setOnMarkerDragListener(this@CapacitorGoogleMap) - this@CapacitorGoogleMap.googleMap?.setOnMapClickListener(this@CapacitorGoogleMap) - this@CapacitorGoogleMap.googleMap?.setOnMyLocationButtonClickListener( - this@CapacitorGoogleMap - ) - this@CapacitorGoogleMap.googleMap?.setOnMyLocationClickListener(this@CapacitorGoogleMap) - this@CapacitorGoogleMap.googleMap?.setOnInfoWindowClickListener(this@CapacitorGoogleMap) - this@CapacitorGoogleMap.googleMap?.setOnPolylineClickListener(this@CapacitorGoogleMap) - } - } - - fun setClusterListeners() { - CoroutineScope(Dispatchers.Main).launch { - clusterManager?.setOnClusterItemClickListener { - if (null == it.googleMapMarker) false - else this@CapacitorGoogleMap.onMarkerClick(it.googleMapMarker!!) - } - - clusterManager?.setOnClusterItemInfoWindowClickListener { - if (null != it.googleMapMarker) { - this@CapacitorGoogleMap.onInfoWindowClick(it.googleMapMarker!!) - } - } - - clusterManager?.setOnClusterInfoWindowClickListener { - val data = this@CapacitorGoogleMap.getClusterData(it) - delegate.notify("onClusterInfoWindowClick", data) - } - - clusterManager?.setOnClusterClickListener { - val data = this@CapacitorGoogleMap.getClusterData(it) - delegate.notify("onClusterClick", data) - false - } - } - } - - private fun getClusterData(it: Cluster): JSObject { - val data = JSObject() - data.put("mapId", this.id) - data.put("latitude", it.position.latitude) - data.put("longitude", it.position.longitude) - data.put("size", it.size) - - val items = JSArray() - for (item in it.items) { - val marker = item.googleMapMarker - - if (marker != null) { - val jsItem = JSObject() - jsItem.put("markerId", marker.id) - jsItem.put("latitude", marker.position.latitude) - jsItem.put("longitude", marker.position.longitude) - jsItem.put("title", marker.title) - jsItem.put("snippet", marker.snippet) - - items.put(jsItem) - } - } - - data.put("items", items) - - return data - } - - override fun onMapClick(point: LatLng) { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("latitude", point.latitude) - data.put("longitude", point.longitude) - delegate.notify("onMapClick", data) - } - - override fun onMarkerClick(marker: Marker): Boolean { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("markerId", marker.id) - data.put("latitude", marker.position.latitude) - data.put("longitude", marker.position.longitude) - data.put("title", marker.title) - data.put("snippet", marker.snippet) - delegate.notify("onMarkerClick", data) - return false - } - - override fun onPolylineClick(polyline: Polyline) { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("polylineId", polyline.id) - data.put("tag", polyline.tag) - delegate.notify("onPolylineClick", data) - } - - override fun onMarkerDrag(marker: Marker) { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("markerId", marker.id) - data.put("latitude", marker.position.latitude) - data.put("longitude", marker.position.longitude) - data.put("title", marker.title) - data.put("snippet", marker.snippet) - delegate.notify("onMarkerDrag", data) - } - - override fun onMarkerDragStart(marker: Marker) { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("markerId", marker.id) - data.put("latitude", marker.position.latitude) - data.put("longitude", marker.position.longitude) - data.put("title", marker.title) - data.put("snippet", marker.snippet) - delegate.notify("onMarkerDragStart", data) - } - - override fun onMarkerDragEnd(marker: Marker) { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("markerId", marker.id) - data.put("latitude", marker.position.latitude) - data.put("longitude", marker.position.longitude) - data.put("title", marker.title) - data.put("snippet", marker.snippet) - delegate.notify("onMarkerDragEnd", data) - } - - override fun onMyLocationButtonClick(): Boolean { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - delegate.notify("onMyLocationButtonClick", data) - return false - } - - override fun onMyLocationClick(location: Location) { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("latitude", location.latitude) - data.put("longitude", location.longitude) - delegate.notify("onMyLocationClick", data) - } - - override fun onCameraIdle() { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("bounds", getLatLngBoundsJSObject(getLatLngBounds())) - data.put("bearing", this@CapacitorGoogleMap.googleMap?.cameraPosition?.bearing) - data.put("latitude", this@CapacitorGoogleMap.googleMap?.cameraPosition?.target?.latitude) - data.put("longitude", this@CapacitorGoogleMap.googleMap?.cameraPosition?.target?.longitude) - data.put("tilt", this@CapacitorGoogleMap.googleMap?.cameraPosition?.tilt) - data.put("zoom", this@CapacitorGoogleMap.googleMap?.cameraPosition?.zoom) - delegate.notify("onCameraIdle", data) - delegate.notify("onBoundsChanged", data) - } - - override fun onCameraMoveStarted(reason: Int) { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("isGesture", reason == 1) - delegate.notify("onCameraMoveStarted", data) - } - - override fun onInfoWindowClick(marker: Marker) { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("markerId", marker.id) - data.put("latitude", marker.position.latitude) - data.put("longitude", marker.position.longitude) - data.put("title", marker.title) - data.put("snippet", marker.snippet) - delegate.notify("onInfoWindowClick", data) - } - - override fun onCameraMove() { - debounceJob?.cancel() - debounceJob = CoroutineScope(Dispatchers.Main).launch { - delay(100) - clusterManager?.cluster() - } - } - - override fun onPolygonClick(polygon: Polygon) { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("polygonId", polygon.id) - data.put("tag", polygon.tag) - delegate.notify("onPolygonClick", data) - } - - override fun onCircleClick(circle: Circle) { - val data = JSObject() - data.put("mapId", this@CapacitorGoogleMap.id) - data.put("circleId", circle.id) - data.put("tag", circle.tag) - data.put("latitude", circle.center.latitude) - data.put("longitude", circle.center.longitude) - data.put("radius", circle.radius) - - delegate.notify("onCircleClick", data) - } -} - -fun getLatLngBoundsJSObject(bounds: LatLngBounds): JSObject { - val data = JSObject() - - val southwestJS = JSObject() - val centerJS = JSObject() - val northeastJS = JSObject() - - southwestJS.put("lat", bounds.southwest.latitude) - southwestJS.put("lng", bounds.southwest.longitude) - centerJS.put("lat", bounds.center.latitude) - centerJS.put("lng", bounds.center.longitude) - northeastJS.put("lat", bounds.northeast.latitude) - northeastJS.put("lng", bounds.northeast.longitude) - - data.put("southwest", southwestJS) - data.put("center", centerJS) - data.put("northeast", northeastJS) - - return data -} diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapMarker.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapMarker.kt deleted file mode 100644 index d99781efb..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapMarker.kt +++ /dev/null @@ -1,93 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import android.graphics.Color -import android.util.Size -import androidx.core.math.MathUtils -import com.google.android.gms.maps.model.* -import com.google.maps.android.clustering.ClusterItem -import org.json.JSONObject - - -class CapacitorGoogleMapMarker(fromJSONObject: JSONObject): ClusterItem { - var coordinate: LatLng = LatLng(0.0, 0.0) - var opacity: Float = 1.0f - private var title: String - private var snippet: String - private var zIndex: Float = 0.0f - var isFlat: Boolean = false - var iconUrl: String? = null - var iconSize: Size? = null - var iconAnchor: CapacitorGoogleMapsPoint? = null - var draggable: Boolean = false - var googleMapMarker: Marker? = null - var colorHue: Float? = null - var markerOptions: MarkerOptions? = null - - init { - if (!fromJSONObject.has("coordinate")) { - throw InvalidArgumentsError("Marker object is missing the required 'coordinate' property") - } - - val latLngObj = fromJSONObject.getJSONObject("coordinate") - if (!latLngObj.has("lat") || !latLngObj.has("lng")) { - throw InvalidArgumentsError("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - coordinate = LatLng(latLngObj.getDouble("lat"), latLngObj.getDouble("lng")) - title = fromJSONObject.optString("title") - opacity = fromJSONObject.optDouble("opacity", 1.0).toFloat() - snippet = fromJSONObject.optString("snippet") - isFlat = fromJSONObject.optBoolean("isFlat", false) - iconUrl = fromJSONObject.optString("iconUrl") - if (fromJSONObject.has("iconSize")) { - val iconSizeObject = fromJSONObject.getJSONObject("iconSize") - iconSize = Size(iconSizeObject.optInt("width", 0), iconSizeObject.optInt("height", 0)) - } - - if (fromJSONObject.has("iconAnchor")) { - val inputAnchorPoint = CapacitorGoogleMapsPoint(fromJSONObject.getJSONObject("iconAnchor")) - iconAnchor = this.buildIconAnchorPoint(inputAnchorPoint) - } - - if (fromJSONObject.has("tintColor")) { - val tintColorObject = fromJSONObject.getJSONObject("tintColor") - - val r = MathUtils.clamp(tintColorObject.optDouble("r", 0.00), 0.00, 255.0) - val g = MathUtils.clamp(tintColorObject.optDouble("g", 0.00), 0.00, 255.0) - val b = MathUtils.clamp(tintColorObject.optDouble("b", 0.00), 0.00, 255.0) - - val hsl = FloatArray(3) - Color.RGBToHSV(r.toInt(), g.toInt(), b.toInt(), hsl) - - colorHue = hsl[0] - } - - draggable = fromJSONObject.optBoolean("draggable", false) - zIndex = fromJSONObject.optLong("zIndex").toFloat() - } - - override fun getPosition(): LatLng { - return LatLng(coordinate.latitude, coordinate.longitude) - } - - override fun getTitle(): String { - return title - } - - override fun getSnippet(): String { - return snippet - } - - override fun getZIndex(): Float { - return zIndex - } - - private fun buildIconAnchorPoint(iconAnchor: CapacitorGoogleMapsPoint): CapacitorGoogleMapsPoint? { - iconSize ?: return null - - val u: Float = iconAnchor.x / iconSize!!.width - val v: Float = iconAnchor.y / iconSize!!.height - - return CapacitorGoogleMapsPoint(u, v) - } -} \ No newline at end of file diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapPolyline.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapPolyline.kt deleted file mode 100644 index ab8935541..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapPolyline.kt +++ /dev/null @@ -1,78 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import android.graphics.Color -import androidx.core.graphics.toColor -import com.google.android.gms.maps.model.LatLng -import com.google.android.gms.maps.model.Polyline -import org.json.JSONObject - -class CapacitorGoogleMapPolyline(fromJSONObject: JSONObject) { - var path: MutableList = mutableListOf() - var styleSpans: MutableList = mutableListOf() - var strokeWidth: Float = 1.0f - var strokeColor: Int = Color.BLUE - var clickable: Boolean - var geodesic: Boolean - var zIndex: Float = 0.00f - var tag: String = "" - var googleMapsPolyline: Polyline? = null - - init { - if (!fromJSONObject.has("path")) { - throw InvalidArgumentsError("Polyline object is missing the required 'path' property") - } - - val pathArray = fromJSONObject.getJSONArray("path") - - for (i in 0 until pathArray.length()) { - val obj = pathArray.getJSONObject(i) - if (!obj.has("lat") || !obj.has("lng")) { - throw InvalidArgumentsError("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - val lat = obj.getDouble("lat") - val lng = obj.getDouble("lng") - - path.add(LatLng(lat, lng)) - } - - if (fromJSONObject.has("styleSpans")) { - val styleSpanArray = fromJSONObject.getJSONArray("styleSpans") - for (i in 0 until styleSpanArray.length()) { - val obj = styleSpanArray.getJSONObject(i) - - if (obj.has("color")) { - val color = obj.getString("color") - - if (obj.has("segments")) { - val segments = obj.getDouble("segments") - styleSpans.add(CapacitorGoogleMapsStyleSpan(Color.parseColor(color), segments)) - } else { - styleSpans.add(CapacitorGoogleMapsStyleSpan(Color.parseColor(color), null)) - } - } - } - } - - val strokeOpacity = fromJSONObject.optDouble("strokeOpacity", 1.0) - - strokeColor = this.processColor(fromJSONObject.getString("strokeColor"), strokeOpacity) - strokeWidth = fromJSONObject.optDouble("strokeWeight", 1.0).toFloat() - clickable = fromJSONObject.optBoolean("clickable", false) - geodesic = fromJSONObject.optBoolean("geodesic", false) - zIndex = fromJSONObject.optDouble("zIndex", 1.0).toFloat() - tag = fromJSONObject.optString("tag", "") - } - - private fun processColor(hex: String, opacity: Double): Int { - val colorInt = Color.parseColor(hex) - - val alpha = (opacity * 255.0).toInt() - val red = android.graphics.Color.red(colorInt) - val green = android.graphics.Color.green(colorInt) - val blue = android.graphics.Color.blue(colorInt) - - return Color.argb(alpha, red, green, blue) - } - -} \ No newline at end of file diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsBounds.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsBounds.kt deleted file mode 100644 index ab757e946..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsBounds.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import org.json.JSONObject - -class CapacitorGoogleMapsBounds(fromJSONObject: JSONObject) { - var width: Int = 0 - var height: Int = 0 - var x: Int = 0 - var y: Int = 0 - - init { - if(!fromJSONObject.has("width")) { - throw InvalidArgumentsError("GoogleMapConfig object is missing the required 'width' property") - } - - if(!fromJSONObject.has("height")) { - throw InvalidArgumentsError("GoogleMapConfig object is missing the required 'height' property") - } - - if(!fromJSONObject.has("x")) { - throw InvalidArgumentsError("GoogleMapConfig object is missing the required 'x' property") - } - - if(!fromJSONObject.has("y")) { - throw InvalidArgumentsError("GoogleMapConfig object is missing the required 'y' property") - } - - width = fromJSONObject.getInt("width") - height = fromJSONObject.getInt("height") - x = fromJSONObject.getInt("x") - y = fromJSONObject.getInt("y") - } -} \ No newline at end of file diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsCircle.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsCircle.kt deleted file mode 100644 index 0463c3df6..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsCircle.kt +++ /dev/null @@ -1,63 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import android.graphics.Color -import com.google.android.gms.maps.model.Circle -import com.google.android.gms.maps.model.LatLng -import org.json.JSONObject - -class CapacitorGoogleMapsCircle(fromJSONObject: JSONObject) { - var center: LatLng - var radius: Float - var strokeWidth: Float = 1.0f - var strokeColor: Int = Color.BLUE - var fillColor: Int = Color.BLUE - var clickable: Boolean - var zIndex: Float = 0.00f - var tag: String = "" - var googleMapsCircle: Circle? = null - - init { - if (!fromJSONObject.has("center")) { - throw InvalidArgumentsError("Circle object is missing the required 'center' property") - } - - if (!fromJSONObject.has("radius")) { - throw InvalidArgumentsError("Circle object is missing the required 'radius' property") - } - - val latLng = fromJSONObject.getJSONObject("center") - if (!latLng.has("lat") || !latLng.has("lng")) { - throw InvalidArgumentsError("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - val lat = latLng.getDouble("lat") - val lng = latLng.getDouble("lng") - - center = LatLng(lat, lng) - - radius = fromJSONObject.getDouble("radius").toFloat() - - val strokeOpacity = fromJSONObject.optDouble("strokeOpacity", 1.0) - strokeColor = this.processColor(fromJSONObject.getString("strokeColor"), strokeOpacity) - - val fillOpacity = fromJSONObject.optDouble("fillOpacity", 1.0) - fillColor = this.processColor(fromJSONObject.getString("fillColor"), fillOpacity) - - strokeWidth = fromJSONObject.optDouble("strokeWeight", 1.0).toFloat() - clickable = fromJSONObject.optBoolean("clickable", false) - zIndex = fromJSONObject.optDouble("zIndex", 1.0).toFloat() - tag = fromJSONObject.optString("tag", "") - } - - - private fun processColor(hex: String, opacity: Double): Int { - val colorInt = Color.parseColor(hex) - - val alpha = (opacity * 255.0).toInt() - val red = android.graphics.Color.red(colorInt) - val green = android.graphics.Color.green(colorInt) - val blue = android.graphics.Color.blue(colorInt) - - return Color.argb(alpha, red, green, blue) - } -} \ No newline at end of file diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsPlugin.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsPlugin.kt deleted file mode 100644 index 143eca887..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsPlugin.kt +++ /dev/null @@ -1,1082 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import android.Manifest -import android.annotation.SuppressLint -import android.graphics.RectF -import android.util.Log -import android.view.MotionEvent -import android.view.View -import com.getcapacitor.* -import com.getcapacitor.annotation.CapacitorPlugin -import com.getcapacitor.annotation.Permission -import com.getcapacitor.annotation.PermissionCallback -import com.google.android.gms.maps.MapsInitializer -import com.google.android.gms.maps.OnMapsSdkInitializedCallback -import com.google.android.gms.maps.model.LatLng -import com.google.android.gms.maps.model.LatLngBounds -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import org.json.JSONArray -import org.json.JSONObject - -@CapacitorPlugin( - name = "CapacitorGoogleMaps", - permissions = - [ - Permission( - strings = [Manifest.permission.ACCESS_FINE_LOCATION], - alias = CapacitorGoogleMapsPlugin.LOCATION - ), - ], -) -class CapacitorGoogleMapsPlugin : Plugin(), OnMapsSdkInitializedCallback { - private var maps: HashMap = HashMap() - private var cachedTouchEvents: HashMap> = HashMap() - private val tag: String = "CAP-GOOGLE-MAPS" - private var touchEnabled: HashMap = HashMap() - - companion object { - const val LOCATION = "location" - } - - @SuppressLint("ClickableViewAccessibility") - override fun load() { - super.load() - - MapsInitializer.initialize(this.context, MapsInitializer.Renderer.LATEST, this) - - - this.bridge.webView.setOnTouchListener( - object : View.OnTouchListener { - override fun onTouch(v: View?, event: MotionEvent?): Boolean { - if (event != null) { - if (event.source == -1) { - return v?.onTouchEvent(event) ?: true - } - - val touchX = event.x - val touchY = event.y - - for ((id, map) in maps) { - if (touchEnabled[id] == false) { - continue - } - val mapRect = map.getMapBounds() - if (mapRect.contains(touchX.toInt(), touchY.toInt())) { - if (event.action == MotionEvent.ACTION_DOWN) { - if (cachedTouchEvents[id] == null) { - cachedTouchEvents[id] = mutableListOf() - } - - cachedTouchEvents[id]?.clear() - } - - val motionEvent = MotionEvent.obtain(event) - cachedTouchEvents[id]?.add(motionEvent) - - val payload = JSObject() - payload.put("x", touchX / map.config.devicePixelRatio) - payload.put("y", touchY / map.config.devicePixelRatio) - payload.put("mapId", map.id) - - notifyListeners("isMapInFocus", payload) - return true - } - } - } - - return v?.onTouchEvent(event) ?: true - } - } - ) - } - - override fun onMapsSdkInitialized(renderer: MapsInitializer.Renderer) { - when (renderer) { - MapsInitializer.Renderer.LATEST -> Logger.debug("Capacitor Google Maps", "Latest Google Maps renderer enabled") - MapsInitializer.Renderer.LEGACY -> Logger.debug("Capacitor Google Maps", "Legacy Google Maps renderer enabled - Cloud based map styling and advanced drawing not available") - } - } - - override fun handleOnStart() { - super.handleOnStart() - maps.forEach { it.value.onStart() } - } - - override fun handleOnResume() { - super.handleOnResume() - maps.forEach { it.value.onResume() } - } - - override fun handleOnPause() { - super.handleOnPause() - maps.forEach { it.value.onPause() } - } - - override fun handleOnStop() { - super.handleOnStop() - maps.forEach { it.value.onStop() } - } - - override fun handleOnDestroy() { - super.handleOnDestroy() - maps.forEach { it.value.onDestroy() } - } - - @PluginMethod - fun create(call: PluginCall) { - try { - val id = call.getString("id") - - if (null == id || id.isEmpty()) { - throw InvalidMapIdError() - } - - val configObject = - call.getObject("config") - ?: throw InvalidArgumentsError("config object is missing") - - val forceCreate = call.getBoolean("forceCreate", false)!! - - val config = GoogleMapConfig(configObject) - - if (maps.contains(id)) { - if (!forceCreate) { - call.resolve() - return - } - - val oldMap = maps.remove(id) - oldMap?.destroy() - } - - val newMap = CapacitorGoogleMap(id, config, this) - maps[id] = newMap - - call.resolve() - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun destroy(call: PluginCall) { - try { - val id = call.getString("id") - - if (null == id || id.isEmpty()) { - throw InvalidMapIdError() - } - - val removedMap = maps.remove(id) ?: throw MapNotFoundError() - removedMap.destroy() - - call.resolve() - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun enableTouch(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - touchEnabled[id] = true - call.resolve() - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun disableTouch(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - touchEnabled[id] = false - call.resolve() - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun addMarker(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val markerObj = call.getObject("marker", null) - markerObj ?: throw InvalidArgumentsError("marker object is missing") - - val map = maps[id] - map ?: throw MapNotFoundError() - - val marker = CapacitorGoogleMapMarker(markerObj) - map.addMarker(marker) { result -> - val markerId = result.getOrThrow() - - val res = JSObject() - res.put("id", markerId) - call.resolve(res) - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun addMarkers(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val markerObjectArray = call.getArray("markers", null) - markerObjectArray ?: throw InvalidArgumentsError("markers array is missing") - - if (markerObjectArray.length() == 0) { - throw InvalidArgumentsError("markers array requires at least one marker") - } - - val map = maps[id] - map ?: throw MapNotFoundError() - - val markers: MutableList = mutableListOf() - - for (i in 0 until markerObjectArray.length()) { - val markerObj = markerObjectArray.getJSONObject(i) - val marker = CapacitorGoogleMapMarker(markerObj) - - markers.add(marker) - } - - map.addMarkers(markers) { result -> - val ids = result.getOrThrow() - - val jsonIDs = JSONArray() - ids.forEach { jsonIDs.put(it) } - - val res = JSObject() - res.put("ids", jsonIDs) - call.resolve(res) - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun addPolygons(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val polygonsObjectArray = call.getArray("polygons", null) - polygonsObjectArray ?: throw InvalidArgumentsError("polygons array is missing") - - if (polygonsObjectArray.length() == 0) { - throw InvalidArgumentsError("polygons requires at least one shape") - } - - val map = maps[id] - map ?: throw MapNotFoundError() - - val polygons: MutableList = mutableListOf() - - for (i in 0 until polygonsObjectArray.length()) { - val polygonObj = polygonsObjectArray.getJSONObject(i) - val polygon = CapacitorGoogleMapsPolygon(polygonObj) - - polygons.add(polygon) - } - - map.addPolygons(polygons) { result -> - val ids = result.getOrThrow() - - val jsonIDs = JSONArray() - ids.forEach { jsonIDs.put(it) } - - val res = JSObject() - res.put("ids", jsonIDs) - call.resolve(res) - } - - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun removePolygons(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val shapeIdsArray = call.getArray("polygonIds") - shapeIdsArray ?: throw InvalidArgumentsError("polygonIds are invalid or missing") - - if (shapeIdsArray.length() == 0) { - throw InvalidArgumentsError("polygonIds requires at least one shape id") - } - - val map = maps[id] - map ?: throw MapNotFoundError() - - val shapeIds: MutableList = mutableListOf() - - for (i in 0 until shapeIdsArray.length()) { - val shapeId = shapeIdsArray.getString(i) - shapeIds.add(shapeId) - } - - map.removePolygons(shapeIds) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun addCircles(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val circlesObjectArray = call.getArray("circles", null) - circlesObjectArray ?: throw InvalidArgumentsError("circles array is missing") - - if (circlesObjectArray.length() == 0) { - throw InvalidArgumentsError("circles array requires at least one circle") - } - - val map = maps[id] - map ?: throw MapNotFoundError() - - val circles: MutableList = mutableListOf() - - for (i in 0 until circlesObjectArray.length()) { - val circleObj = circlesObjectArray.getJSONObject(i) - val circle = CapacitorGoogleMapsCircle(circleObj) - - circles.add(circle) - } - - map.addCircles(circles) { result -> - val ids = result.getOrThrow() - - val jsonIDs = JSONArray() - ids.forEach { jsonIDs.put(it) } - - val res = JSObject() - res.put("ids", jsonIDs) - call.resolve(res) - } - - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun addPolylines(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val polylinesObjectArray = call.getArray("polylines", null) - polylinesObjectArray ?: throw InvalidArgumentsError("polylines array is missing") - - if (polylinesObjectArray.length() == 0) { - throw InvalidArgumentsError("polylines requires at least one line") - } - - val map = maps[id] - map ?: throw MapNotFoundError() - - val polylines: MutableList = mutableListOf() - - for (i in 0 until polylinesObjectArray.length()) { - val polylineObj = polylinesObjectArray.getJSONObject(i) - val polyline = CapacitorGoogleMapPolyline(polylineObj) - - polylines.add(polyline) - } - - map.addPolylines(polylines) { result -> - val ids = result.getOrThrow() - - val jsonIDs = JSONArray() - ids.forEach { jsonIDs.put(it) } - - val res = JSObject() - res.put("ids", jsonIDs) - call.resolve(res) - } - - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun removeCircles(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val circleIdsArray = call.getArray("circleIds") - circleIdsArray ?: throw InvalidArgumentsError("circleIds are invalid or missing") - - if (circleIdsArray.length() == 0) { - throw InvalidArgumentsError("circleIds requires at least one circle id") - } - - val map = maps[id] - map ?: throw MapNotFoundError() - - val circleIds: MutableList = mutableListOf() - - for (i in 0 until circleIdsArray.length()) { - val circleId = circleIdsArray.getString(i) - circleIds.add(circleId) - } - - map.removeCircles(circleIds) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun enableClustering(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val minClusterSize = call.getInt("minClusterSize") - - val map = maps[id] - map ?: throw MapNotFoundError() - - map.enableClustering(minClusterSize, { err -> - if (err != null) { - throw err - } - - call.resolve() - }) - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun disableClustering(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - map.disableClustering { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun removeMarker(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val markerId = call.getString("markerId") - markerId ?: throw InvalidArgumentsError("markerId is invalid or missing") - - val map = maps[id] - map ?: throw MapNotFoundError() - - map.removeMarker(markerId) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun removeMarkers(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val markerIdsArray = call.getArray("markerIds") - markerIdsArray ?: throw InvalidArgumentsError("markerIds are invalid or missing") - - if (markerIdsArray.length() == 0) { - throw InvalidArgumentsError("markerIds requires at least one marker id") - } - - val map = maps[id] - map ?: throw MapNotFoundError() - - val markerIds: MutableList = mutableListOf() - - for (i in 0 until markerIdsArray.length()) { - val markerId = markerIdsArray.getString(i) - markerIds.add(markerId) - } - - map.removeMarkers(markerIds) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun removePolylines(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val lineIdsArray = call.getArray("polylineIds") - lineIdsArray ?: throw InvalidArgumentsError("polylineIds are invalid or missing") - - if (lineIdsArray.length() == 0) { - throw InvalidArgumentsError("polylineIds requires at least one line id") - } - - val map = maps[id] - map ?: throw MapNotFoundError() - - val lineIds: MutableList = mutableListOf() - - for (i in 0 until lineIdsArray.length()) { - val markerId = lineIdsArray.getString(i) - lineIds.add(markerId) - } - - map.removePolylines(lineIds) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun setCamera(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - val cameraConfigObject = - call.getObject("config") - ?: throw InvalidArgumentsError("config object is missing") - - val config = GoogleMapCameraConfig(cameraConfigObject) - - map.setCamera(config) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun getMapType(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - map.getMapType() { type, err -> - - if (err != null) { - throw err - } - val data = JSObject() - data.put("type", type) - call.resolve(data) - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun setMapType(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - val mapType = - call.getString("mapType") ?: throw InvalidArgumentsError("mapType is missing") - - map.setMapType(mapType) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun enableIndoorMaps(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - val enabled = - call.getBoolean("enabled") ?: throw InvalidArgumentsError("enabled is missing") - - map.enableIndoorMaps(enabled) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun enableTrafficLayer(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - val enabled = - call.getBoolean("enabled") ?: throw InvalidArgumentsError("enabled is missing") - - map.enableTrafficLayer(enabled) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun enableCurrentLocation(call: PluginCall) { - if (getPermissionState(LOCATION) != PermissionState.GRANTED) { - requestAllPermissions(call, "enableCurrentLocationCallback") - } else { - internalEnableCurrentLocation(call) - } - } - - @PermissionCallback - fun enableCurrentLocationCallback(call: PluginCall) { - if (getPermissionState(LOCATION) == PermissionState.GRANTED) { - internalEnableCurrentLocation(call) - } else { - call.reject("location permission was denied") - } - } - - @PluginMethod - fun setPadding(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - val paddingObj = - call.getObject("padding") ?: throw InvalidArgumentsError("padding is missing") - - val padding = GoogleMapPadding(paddingObj) - - map.setPadding(padding) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun enableAccessibilityElements(call: PluginCall) { - call.unavailable("this call is not available on android") - } - - @PluginMethod - fun onScroll(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - val boundsObj = - call.getObject("mapBounds") - ?: throw InvalidArgumentsError("mapBounds object is missing") - - val bounds = boundsObjectToRect(boundsObj) - - map.updateRender(bounds) - - call.resolve() - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun onResize(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - val boundsObj = - call.getObject("mapBounds") - ?: throw InvalidArgumentsError("mapBounds object is missing") - - val bounds = boundsObjectToRect(boundsObj) - - map.updateRender(bounds) - - call.resolve() - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun onDisplay(call: PluginCall) { - call.unavailable("this call is not available on android") - } - - @PluginMethod - fun dispatchMapEvent(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - val focus = call.getBoolean("focus", false)!! - - val events = cachedTouchEvents[id] - if (events != null) { - while(events.size > 0) { - val event = events.first() - if (focus) { - map.dispatchTouchEvent(event) - } else { - this.bridge.webView.onTouchEvent(event) - } - events.removeFirst() - } - } - - call.resolve() - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun getMapBounds(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - CoroutineScope(Dispatchers.Main).launch { - val bounds = map.getLatLngBounds() - val data = getLatLngBoundsJSObject(bounds) - call.resolve(data) - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun mapBoundsContains(call: PluginCall) { - try { - val boundsObject = call.getObject("bounds") - val pointObject = call.getObject("point") - - CoroutineScope(Dispatchers.Main).launch { - val bounds = createLatLngBounds(boundsObject) - val point = createLatLng(pointObject) - val contains = bounds.contains(point) - val data = JSObject() - data.put("contains", contains) - call.resolve(data) - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun fitBounds(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - val boundsObject = - call.getObject("bounds") ?: throw InvalidArgumentsError("bounds is missing") - - val padding = call.getInt("padding", 0)!! - - CoroutineScope(Dispatchers.Main).launch { - val bounds = createLatLngBounds(boundsObject) - map.fitBounds(bounds, padding) - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - @PluginMethod - fun mapBoundsExtend(call: PluginCall) { - try { - val boundsObject = call.getObject("bounds") - val pointObject = call.getObject("point") - - CoroutineScope(Dispatchers.Main).launch { - val bounds = createLatLngBounds(boundsObject) - val point = createLatLng(pointObject) - val newBounds = bounds.including(point) - val data = JSObject() - data.put("bounds", getLatLngBoundsJSObject(newBounds)) - call.resolve(data) - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - private fun createLatLng(point: JSObject): LatLng { - return LatLng( - point.getDouble("lat"), - point.getDouble("lng") - ) - } - - private fun createLatLngBounds(boundsObject: JSObject): LatLngBounds { - val southwestObject = boundsObject.getJSObject("southwest")!! - val southwestLatLng = createLatLng(southwestObject) - - val northeastObject = boundsObject.getJSObject("northeast")!! - val northeastLatLng = createLatLng(northeastObject) - - return LatLngBounds(southwestLatLng, northeastLatLng) - } - - private fun internalEnableCurrentLocation(call: PluginCall) { - try { - val id = call.getString("id") - id ?: throw InvalidMapIdError() - - val map = maps[id] - map ?: throw MapNotFoundError() - - val enabled = - call.getBoolean("enabled") ?: throw InvalidArgumentsError("enabled is missing") - - map.enableCurrentLocation(enabled) { err -> - if (err != null) { - throw err - } - - call.resolve() - } - } catch (e: GoogleMapsError) { - handleError(call, e) - } catch (e: Exception) { - handleError(call, e) - } - } - - fun notify(event: String, data: JSObject) { - notifyListeners(event, data) - } - - private fun handleError(call: PluginCall, e: Exception) { - val error: GoogleMapErrorObject = getErrorObject(e) - Log.w(tag, error.toString()) - call.reject(error.message, error.code.toString(), e) - } - - private fun handleError(call: PluginCall, e: GoogleMapsError) { - val error: GoogleMapErrorObject = getErrorObject(e) - Log.w(tag, error.toString()) - call.reject(error.message, error.code.toString()) - } - - private fun boundsObjectToRect(jsonObject: JSONObject): RectF { - if (!jsonObject.has("width")) { - throw InvalidArgumentsError( - "GoogleMapConfig object is missing the required 'width' property" - ) - } - - if (!jsonObject.has("height")) { - throw InvalidArgumentsError( - "GoogleMapConfig object is missing the required 'height' property" - ) - } - - if (!jsonObject.has("x")) { - throw InvalidArgumentsError( - "GoogleMapConfig object is missing the required 'x' property" - ) - } - - if (!jsonObject.has("y")) { - throw InvalidArgumentsError( - "GoogleMapConfig object is missing the required 'y' property" - ) - } - - val width = jsonObject.getDouble("width") - val height = jsonObject.getDouble("height") - val x = jsonObject.getDouble("x") - val y = jsonObject.getDouble("y") - - return RectF(x.toFloat(), y.toFloat(), (x + width).toFloat(), (y + height).toFloat()) - } -} diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsPoint.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsPoint.kt deleted file mode 100644 index c37087191..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsPoint.kt +++ /dev/null @@ -1,23 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import org.json.JSONObject - -class CapacitorGoogleMapsPoint() { - var x: Float = 0.00f - var y: Float = 0.00f - - constructor(fromJSONObject: JSONObject) : this() { - if(fromJSONObject.has("x")) { - this.x = fromJSONObject.getDouble("x").toFloat() - } - - if(fromJSONObject.has("y")) { - this.y = fromJSONObject.getDouble("y").toFloat() - } - } - - constructor(x: Float, y: Float) : this() { - this.x = x; - this.y = y - } -} \ No newline at end of file diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsPolygon.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsPolygon.kt deleted file mode 100644 index fba296dde..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsPolygon.kt +++ /dev/null @@ -1,80 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import android.graphics.Color -import com.google.android.gms.maps.model.LatLng -import com.google.android.gms.maps.model.Polygon -import org.json.JSONArray -import org.json.JSONObject - -class CapacitorGoogleMapsPolygon(fromJSONObject: JSONObject) { - var shapes: MutableList> = mutableListOf>() - var strokeWidth: Float = 1.0f - var strokeColor: Int = Color.BLUE - var fillColor: Int = Color.BLUE - var clickable: Boolean - var geodesic: Boolean - var zIndex: Float = 0.00f - var tag: String = "" - var googleMapsPolygon: Polygon? = null - - init { - if (!fromJSONObject.has("paths")) { - throw InvalidArgumentsError("Polygon object is missing the required 'paths' property") - } - - val pathsArray = fromJSONObject.getJSONArray("paths") - for (i in 0 until pathsArray.length()) { - val arr = pathsArray.optJSONArray(i) - if (arr == null) { - // is a single shape - val shape = this.processShape(pathsArray) - this.shapes.add(shape) - break - } else { - val shape = this.processShape(arr) - this.shapes.add(shape) - } - } - - val strokeOpacity = fromJSONObject.optDouble("strokeOpacity", 1.0) - strokeColor = this.processColor(fromJSONObject.getString("strokeColor"), strokeOpacity) - - val fillOpacity = fromJSONObject.optDouble("fillOpacity", 1.0) - fillColor = this.processColor(fromJSONObject.getString("fillColor"), fillOpacity) - - strokeWidth = fromJSONObject.optDouble("strokeWeight", 1.0).toFloat() - clickable = fromJSONObject.optBoolean("clickable", false) - geodesic = fromJSONObject.optBoolean("geodesic", false) - zIndex = fromJSONObject.optDouble("zIndex", 1.0).toFloat() - tag = fromJSONObject.optString("tag", "") - } - - private fun processShape(shapeArr: JSONArray): MutableList { - var shape = mutableListOf() - - for (i in 0 until shapeArr.length()) { - val obj = shapeArr.getJSONObject(i) - if (!obj.has("lat") || !obj.has("lng")) { - throw InvalidArgumentsError("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - val lat = obj.getDouble("lat") - val lng = obj.getDouble("lng") - - shape.add(LatLng(lat, lng)) - } - - return shape - } - - private fun processColor(hex: String, opacity: Double): Int { - val colorInt = Color.parseColor(hex) - - val alpha = (opacity * 255.0).toInt() - val red = android.graphics.Color.red(colorInt) - val green = android.graphics.Color.green(colorInt) - val blue = android.graphics.Color.blue(colorInt) - - return Color.argb(alpha, red, green, blue) - } -} \ No newline at end of file diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsStyleSpan.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsStyleSpan.kt deleted file mode 100644 index 68ba0f493..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMapsStyleSpan.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import android.graphics.Color - -data class CapacitorGoogleMapsStyleSpan(val color: Int, val segments: Double?) diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapCameraConfig.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapCameraConfig.kt deleted file mode 100644 index b072b2c0f..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapCameraConfig.kt +++ /dev/null @@ -1,50 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import com.google.android.gms.maps.model.LatLng -import org.json.JSONObject - -class GoogleMapCameraConfig(fromJSONObject: JSONObject) { - var coordinate: LatLng? = null - var zoom: Double? = null - var angle: Double? = null - var bearing: Double? = null - var animate: Boolean? = null - var animationDuration: Double? = null - - init { - if (fromJSONObject.has("zoom")) { - zoom = fromJSONObject.getDouble("zoom") - } - - if(fromJSONObject.has("angle")) { - angle = fromJSONObject.getDouble("angle") - } - - if (fromJSONObject.has("bearing")) { - bearing = fromJSONObject.getDouble("bearing") - } - - if (fromJSONObject.has("animate")) { - animate = fromJSONObject.getBoolean("animate") - } - - if (fromJSONObject.has("animationDuration")) { - animationDuration = fromJSONObject.getDouble("animationDuration") - } - - if (fromJSONObject.has("coordinate")) { - val coordinateJSONObject = fromJSONObject.getJSONObject("coordinate") - if(!coordinateJSONObject.has("lat") || !coordinateJSONObject.has("lng")) { - throw InvalidArgumentsError("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - val lat = coordinateJSONObject.getDouble("lat") - val lng = coordinateJSONObject.getDouble("lng") - coordinate = LatLng(lat, lng) - } else { - coordinate = null - } - } - - -} \ No newline at end of file diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapConfig.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapConfig.kt deleted file mode 100644 index bc29ae08f..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapConfig.kt +++ /dev/null @@ -1,95 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import com.google.android.gms.maps.GoogleMapOptions -import com.google.android.gms.maps.model.CameraPosition -import com.google.android.gms.maps.model.LatLng -import org.json.JSONObject - -class GoogleMapConfig(fromJSONObject: JSONObject) { - var width: Int = 0 - var height: Int = 0 - var x: Int = 0 - var y: Int = 0 - var center: LatLng = LatLng(0.0, 0.0) - var googleMapOptions: GoogleMapOptions? = null - var zoom: Int = 0 - var liteMode: Boolean = false - var devicePixelRatio: Float = 1.00f - var styles: String? = null - var mapId: String? = null - - init { - if (!fromJSONObject.has("width")) { - throw InvalidArgumentsError( - "GoogleMapConfig object is missing the required 'width' property" - ) - } - - if (!fromJSONObject.has("height")) { - throw InvalidArgumentsError( - "GoogleMapConfig object is missing the required 'height' property" - ) - } - - if (!fromJSONObject.has("x")) { - throw InvalidArgumentsError( - "GoogleMapConfig object is missing the required 'x' property" - ) - } - - if (!fromJSONObject.has("y")) { - throw InvalidArgumentsError( - "GoogleMapConfig object is missing the required 'y' property" - ) - } - - if (!fromJSONObject.has("zoom")) { - throw InvalidArgumentsError( - "GoogleMapConfig object is missing the required 'zoom' property" - ) - } - - if (fromJSONObject.has("devicePixelRatio")) { - devicePixelRatio = fromJSONObject.getDouble("devicePixelRatio").toFloat() - } - - if (!fromJSONObject.has("center")) { - throw InvalidArgumentsError( - "GoogleMapConfig object is missing the required 'center' property" - ) - } - - val centerJSONObject = fromJSONObject.getJSONObject("center") - - if (!centerJSONObject.has("lat") || !centerJSONObject.has("lng")) { - throw InvalidArgumentsError( - "LatLng object is missing the required 'lat' and/or 'lng' property" - ) - } - - liteMode = - fromJSONObject.has("androidLiteMode") && - fromJSONObject.getBoolean("androidLiteMode") - - width = fromJSONObject.getInt("width") - height = fromJSONObject.getInt("height") - x = fromJSONObject.getInt("x") - y = fromJSONObject.getInt("y") - zoom = fromJSONObject.getInt("zoom") - - val lat = centerJSONObject.getDouble("lat") - val lng = centerJSONObject.getDouble("lng") - center = LatLng(lat, lng) - - val cameraPosition = CameraPosition(center, zoom.toFloat(), 0.0F, 0.0F) - - styles = fromJSONObject.getString("styles") - - mapId = fromJSONObject.getString("androidMapId") - - googleMapOptions = GoogleMapOptions().camera(cameraPosition).liteMode(liteMode) - if (mapId != null) { - googleMapOptions?.mapId(mapId!!) - } - } -} diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapErrors.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapErrors.kt deleted file mode 100644 index b4fc86330..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapErrors.kt +++ /dev/null @@ -1,105 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import org.json.JSONObject -import kotlin.Exception - -enum class GoogleMapErrors { - UNHANDLED_ERROR, INVALID_MAP_ID, MAP_NOT_FOUND, MARKER_NOT_FOUND, INVALID_ARGUMENTS, PERMISSIONS_DENIED_LOCATION, GOOGLE_MAP_NOT_AVAILABLE, BOUNDS_NOT_FOUND -} - -class GoogleMapErrorObject(val code: Int, val message: String, val extra: HashMap = HashMap()) { - private fun asJSONObject(): JSONObject { - val returnJSONObject = JSONObject() - - returnJSONObject.put("code", code) - returnJSONObject.put("message", message) - returnJSONObject.put("extra", extra) - - return returnJSONObject - } - - override fun toString(): String { - return this.asJSONObject().toString() - } -} - -fun getErrorObject(err: GoogleMapsError): GoogleMapErrorObject { - return when(err) { - is InvalidArgumentsError -> { - GoogleMapErrorObject(err.getErrorCode(), "Invalid Arguments Provided: ${err.message}.") - } - is InvalidMapIdError -> { - GoogleMapErrorObject(err.getErrorCode(), "Missing or invalid map id.") - } - is MapNotFoundError -> { - GoogleMapErrorObject(err.getErrorCode(), "Map not found for provided id.") - } - is MarkerNotFoundError -> { - GoogleMapErrorObject(err.getErrorCode(), "Marker not found for provided id.") - } - is PermissionDeniedLocation -> { - GoogleMapErrorObject(err.getErrorCode(), "Permissions denied for accessing device location.") - } - is GoogleMapNotAvailable -> { - GoogleMapErrorObject(err.getErrorCode(), "Google Map is not available.") - } - is BoundsNotFoundError -> { - GoogleMapErrorObject(err.getErrorCode(), "Google Map Bounds could not be found.") - } - else -> { - GoogleMapErrorObject(err.getErrorCode(), "Unhandled Error: ${err.message}.") - } - } -} - -fun getErrorObject(err: Exception): GoogleMapErrorObject { - return GoogleMapErrorObject(0, "Unhandled Error: ${err.message}.") -} - -open class GoogleMapsError(message: String? = ""): Throwable(message) { - open fun getErrorCode(): Int { - return GoogleMapErrors.UNHANDLED_ERROR.ordinal - } -} - -class InvalidMapIdError(message: String? = ""): GoogleMapsError(message) { - override fun getErrorCode(): Int { - return GoogleMapErrors.INVALID_MAP_ID.ordinal - } -} - -class MapNotFoundError(message: String? = ""): GoogleMapsError(message) { - override fun getErrorCode(): Int { - return GoogleMapErrors.MAP_NOT_FOUND.ordinal - } -} - -class MarkerNotFoundError(message: String? = ""): GoogleMapsError(message) { - override fun getErrorCode(): Int { - return GoogleMapErrors.MARKER_NOT_FOUND.ordinal - } -} - -class InvalidArgumentsError(message: String? = ""): GoogleMapsError(message) { - override fun getErrorCode(): Int { - return GoogleMapErrors.INVALID_ARGUMENTS.ordinal - } -} - -class PermissionDeniedLocation(message: String? = ""): GoogleMapsError(message) { - override fun getErrorCode(): Int { - return GoogleMapErrors.PERMISSIONS_DENIED_LOCATION.ordinal - } -} - -class GoogleMapNotAvailable(message: String? = ""): GoogleMapsError(message) { - override fun getErrorCode(): Int { - return GoogleMapErrors.GOOGLE_MAP_NOT_AVAILABLE.ordinal - } -} - -class BoundsNotFoundError(message: String? = ""): GoogleMapsError(message) { - override fun getErrorCode(): Int { - return GoogleMapErrors.BOUNDS_NOT_FOUND.ordinal - } -} diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapPadding.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapPadding.kt deleted file mode 100644 index c14dac52d..000000000 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/GoogleMapPadding.kt +++ /dev/null @@ -1,28 +0,0 @@ -package com.capacitorjs.plugins.googlemaps - -import org.json.JSONObject - -class GoogleMapPadding(fromJSONObject: JSONObject) { - var top: Int = 0 - var bottom: Int = 0 - var left: Int = 0 - var right: Int = 0 - - init { - if(fromJSONObject.has("top")) { - top = fromJSONObject.getInt("top") - } - - if(fromJSONObject.has("bottom")) { - bottom = fromJSONObject.getInt("bottom") - } - - if(fromJSONObject.has("left")) { - left = fromJSONObject.getInt("left") - } - - if(fromJSONObject.has("right")) { - right = fromJSONObject.getInt("right") - } - } -} \ No newline at end of file diff --git a/google-maps/android/src/main/res/.gitkeep b/google-maps/android/src/main/res/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/google-maps/e2e-tests/.env.example b/google-maps/e2e-tests/.env.example deleted file mode 100644 index f4f1a8439..000000000 --- a/google-maps/e2e-tests/.env.example +++ /dev/null @@ -1 +0,0 @@ -REACT_APP_GOOGLE_MAPS_API_KEY= \ No newline at end of file diff --git a/google-maps/e2e-tests/.gitignore b/google-maps/e2e-tests/.gitignore deleted file mode 100644 index 3b0b1aea6..000000000 --- a/google-maps/e2e-tests/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local -.vscode -.idea - -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Optional eslint cache -.eslintcache - -.ionic/* -!.ionic/e2e.env -!.ionic/wdio.config.ts diff --git a/google-maps/e2e-tests/.ionic/e2e.env b/google-maps/e2e-tests/.ionic/e2e.env deleted file mode 100644 index e8b0746f9..000000000 --- a/google-maps/e2e-tests/.ionic/e2e.env +++ /dev/null @@ -1,9 +0,0 @@ -E2E_ANDROID_ACTIVITY=io.ionic.starter.MainActivity -E2E_IOS_SIMULATOR_DEVICE_NAME=iPhone 13 Pro Max -E2E_IOS_SIMULATOR_PLATFORM_VERSION=15.0 -E2E_IOS_DEVICE_NAME=iPhone 12 Pro Max -E2E_IOS_DEVICE_PLATFORM_VERSION=15.2 -E2E_ANDROID_EMULATOR_DEVICE_NAME=e2eDevice -E2E_ANDROID_EMULATOR_PLATFORM_VERSION=12 -E2E_ANDROID_DEVICE_NAME=G8X -E2E_ANDROID_DEVICE_PLATFORM_VERSION=11 \ No newline at end of file diff --git a/google-maps/e2e-tests/.ionic/wdio.config.ts b/google-maps/e2e-tests/.ionic/wdio.config.ts deleted file mode 100644 index d0c57fedf..000000000 --- a/google-maps/e2e-tests/.ionic/wdio.config.ts +++ /dev/null @@ -1,174 +0,0 @@ -exports.config = { - "autoCompileOpts": { - "autoCompile": true, - "tsNodeOpts": { - "transpileOnly": true - }, - "tsConfigPathsOpts": { - "paths": {}, - "baseUrl": "./" - } - }, - "runner": "local", - "specs": [ - [ - "./tests/specs/**/*.spec.ts" - ] - ], - "logLevel": "trace", - "bail": 0, - "waitforTimeout": 45000, - "connectionRetryTimeout": 120000, - "connectionRetryCount": 3, - "framework": "mocha", - "reporters": [ - "spec" - ], - "mochaOpts": { - "timeout": 1200000 - }, - "services": [ - [ - "appium", - { - "command": "appium", - "args": { - "relaxedSecurity": true - } - } - ], - [ - "chromedriver", - { - "args": [ - "--use-fake-ui-for-media-stream", - "--use-fake-device-for-media-stream" - ] - } - ] - ], - "port": 4723, - "ios:simulator": { - "platformName": "iOS", - "maxInstances": 1, - "appium:isHeadless": true, - "appium:deviceName": "iPhone 13 Pro Max", - "appium:platformVersion": "15.2", - "appium:orientation": "PORTRAIT", - "appium:automationName": "XCUITest", - "appium:app": "./.ionic/App-ios-simulator.zip", - "appium:newCommandTimeout": 240, - "appium:platformName": "iOS", - "appium:wdaLaunchTimeout": 600000 - }, - "ios:device": { - "platformName": "iOS", - "maxInstances": 1, - "appium:isHeadless": false, - "appium:deviceName": "iPhone 12 Pro Max", - "appium:platformVersion": "15.2", - "appium:orientation": "PORTRAIT", - "appium:automationName": "XCUITest", - "appium:app": "./.ionic/App-ios-simulator.zip", - "appium:newCommandTimeout": 240 - }, - "ios:browser": { - "browserName": "safari", - "platformName": "iOS", - "maxInstances": 1, - "appium:isHeadless": false, - "appium:deviceName": "iPhone 13 Pro Max", - "appium:platformVersion": "15.0", - "appium:orientation": "PORTRAIT", - "appium:automationName": "XCUITest", - "appium:newCommandTimeout": 240 - }, - "android:emulator": { - "platformName": "Android", - "maxInstances": 1, - "appium:isHeadless": true, - "appium:deviceName": "e2eDevice", - "appium:platformVersion": "11.0", - "appium:orientation": "PORTRAIT", - "appium:automationName": "UiAutomator2", - "appium:app": "./.ionic/app-debug.apk", - "appium:appWaitActivity": "io.ionic.starter.MainActivity", - "appium:newCommandTimeout": 300, - "appium:platformName": "Android", - "appium:avd": "e2eDevice", - "appium:appPackage": "io.ionic.starter", - "appium:autoGrantPermissions": true, - "appium:allowTestPackages": true, - "appium:appWaitDuration": 60000, - "appium:adbExecTimeout": 300000, - "appium:deviceReadyTimeout": 3000, - "appium:androidDeviceReadyTimeout": 3000, - "appium:avdLaunchTimeout": 300000, - "appium:avdReadyTimeout": 300000, - "appium:appWaitForLaunch": false, - "appium:avdArgs": "-no-window -noaudio -verbose -accel on -no-boot-anim -no-snapshot-save" - }, - "android:device": { - "platformName": "Android", - "maxInstances": 1, - "appium:isHeadless": false, - "appium:deviceName": "G8X", - "appium:platformVersion": "11", - "appium:orientation": "PORTRAIT", - "appium:automationName": "UiAutomator2", - "appium:app": "./.ionic/app-debug.apk", - "appium:appWaitActivity": "io.ionic.starter.MainActivity", - "appium:newCommandTimeout": 240 - }, - "android:browser": { - "platformName": "Android", - "browserName": "chrome", - "maxInstances": 1, - "appium:isHeadless": false, - "appium:deviceName": "e2eDevice", - "appium:platformVersion": "12", - "appium:orientation": "PORTRAIT", - "appium:newCommandTimeout": 240 - }, - "web:chrome": { - "maxInstances": 1, - "browserName": "chrome", - "wdio:devtoolsOptions": { - "headless": true - }, - "goog:chromeOptions": { - "prefs": { - "profile.default_content_setting_values.media_stream_camera": 1, - "profile.default_content_setting_values.media_stream_mic": 1, - "profile.default_content_setting_values.notifications": 1 - } - } - }, - "capabilities": [ - { - "platformName": "Android", - "maxInstances": 1, - "appium:isHeadless": true, - "appium:deviceName": "e2eDevice", - "appium:platformVersion": "11.0", - "appium:orientation": "PORTRAIT", - "appium:automationName": "UiAutomator2", - "appium:app": "./.ionic/app-debug.apk", - "appium:appWaitActivity": "io.ionic.starter.MainActivity", - "appium:newCommandTimeout": 300, - "appium:platformName": "Android", - "appium:avd": "e2eDevice", - "appium:appPackage": "io.ionic.starter", - "appium:autoGrantPermissions": true, - "appium:allowTestPackages": true, - "appium:appWaitDuration": 60000, - "appium:adbExecTimeout": 300000, - "appium:deviceReadyTimeout": 3000, - "appium:androidDeviceReadyTimeout": 3000, - "appium:avdLaunchTimeout": 300000, - "appium:avdReadyTimeout": 300000, - "appium:appWaitForLaunch": false, - "appium:avdArgs": "-no-window -noaudio -verbose -accel on -no-boot-anim -no-snapshot-save" - } - ] - } \ No newline at end of file diff --git a/google-maps/e2e-tests/.npmrc b/google-maps/e2e-tests/.npmrc deleted file mode 100644 index 9cf949503..000000000 --- a/google-maps/e2e-tests/.npmrc +++ /dev/null @@ -1 +0,0 @@ -package-lock=false \ No newline at end of file diff --git a/google-maps/e2e-tests/android/.gitignore b/google-maps/e2e-tests/android/.gitignore deleted file mode 100644 index 48354a3df..000000000 --- a/google-maps/e2e-tests/android/.gitignore +++ /dev/null @@ -1,101 +0,0 @@ -# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore - -# Built application files -*.apk -*.aar -*.ap_ -*.aab - -# Files for the ART/Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin/ -gen/ -out/ -# Uncomment the following line in case you need and you don't have the release build type files in your app -# release/ - -# Gradle files -.gradle/ -build/ - -# Local configuration file (sdk path, etc) -local.properties - -# Proguard folder generated by Eclipse -proguard/ - -# Log Files -*.log - -# Android Studio Navigation editor temp files -.navigation/ - -# Android Studio captures folder -captures/ - -# IntelliJ -*.iml -.idea/workspace.xml -.idea/tasks.xml -.idea/gradle.xml -.idea/assetWizardSettings.xml -.idea/dictionaries -.idea/libraries -# Android Studio 3 in .gitignore file. -.idea/caches -.idea/modules.xml -# Comment next line if keeping position of elements in Navigation Editor is relevant for you -.idea/navEditor.xml - -# Keystore files -# Uncomment the following lines if you do not want to check your keystore files in. -#*.jks -#*.keystore - -# External native build folder generated in Android Studio 2.2 and later -.externalNativeBuild -.cxx/ - -# Google Services (e.g. APIs or Firebase) -# google-services.json - -# Freeline -freeline.py -freeline/ -freeline_project_description.json - -# fastlane -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output -fastlane/readme.md - -# Version control -vcs.xml - -# lint -lint/intermediates/ -lint/generated/ -lint/outputs/ -lint/tmp/ -# lint/reports/ - -# Android Profiling -*.hprof - -# Cordova plugins for Capacitor -capacitor-cordova-android-plugins - -# Copied web assets -app/src/main/assets/public - -# Generated Config files -app/src/main/assets/capacitor.config.json -app/src/main/assets/capacitor.plugins.json -app/src/main/res/xml/config.xml diff --git a/google-maps/e2e-tests/android/app/.gitignore b/google-maps/e2e-tests/android/app/.gitignore deleted file mode 100644 index 043df802a..000000000 --- a/google-maps/e2e-tests/android/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build/* -!/build/.npmkeep diff --git a/google-maps/e2e-tests/android/app/build.gradle b/google-maps/e2e-tests/android/app/build.gradle deleted file mode 100644 index f8a8988d9..000000000 --- a/google-maps/e2e-tests/android/app/build.gradle +++ /dev/null @@ -1,72 +0,0 @@ -plugins { - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -apply plugin: 'com.android.application' - -def getApiKey() { - Properties properties = new Properties() - if (project.rootProject.file('local.properties').canRead()) { - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - - if(properties.containsKey("REACT_APP_GOOGLE_MAPS_API_KEY")) { - return properties['REACT_APP_GOOGLE_MAPS_API_KEY'] - } - } - return System.getenv('REACT_APP_GOOGLE_MAPS_API_KEY') - } - - -android { - namespace "io.ionic.starter" - compileSdkVersion rootProject.ext.compileSdkVersion - defaultConfig { - applicationId "io.ionic.starter" - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1 - versionName "1.0" - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - aaptOptions { - // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. - // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 - ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' - } - manifestPlaceholders = [MAPS_API_KEY:"${getApiKey()}"] - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -repositories { - flatDir{ - dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" - implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" - implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" - implementation project(':capacitor-android') - testImplementation "junit:junit:$junitVersion" - androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" - androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" - implementation project(':capacitor-cordova-android-plugins') -} - -apply from: 'capacitor.build.gradle' - -try { - def servicesJSON = file('google-services.json') - if (servicesJSON.text) { - apply plugin: 'com.google.gms.google-services' - } -} catch(Exception e) { - logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") -} diff --git a/google-maps/e2e-tests/android/app/capacitor.build.gradle b/google-maps/e2e-tests/android/app/capacitor.build.gradle deleted file mode 100644 index 6ff7d3323..000000000 --- a/google-maps/e2e-tests/android/app/capacitor.build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN - -android { - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } -} - -apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" -dependencies { - implementation project(':capacitor-app') - implementation project(':capacitor-google-maps') - implementation project(':capacitor-haptics') - implementation project(':capacitor-keyboard') - implementation project(':capacitor-status-bar') - -} - - -if (hasProperty('postBuildExtras')) { - postBuildExtras() -} diff --git a/google-maps/e2e-tests/android/app/proguard-rules.pro b/google-maps/e2e-tests/android/app/proguard-rules.pro deleted file mode 100644 index f1b424510..000000000 --- a/google-maps/e2e-tests/android/app/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/google-maps/e2e-tests/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java b/google-maps/e2e-tests/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java deleted file mode 100644 index f2c2217ef..000000000 --- a/google-maps/e2e-tests/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.getcapacitor.myapp; - -import static org.junit.Assert.*; - -import android.content.Context; -import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.test.platform.app.InstrumentationRegistry; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Instrumented test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - - @Test - public void useAppContext() throws Exception { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - - assertEquals("com.getcapacitor.app", appContext.getPackageName()); - } -} diff --git a/google-maps/e2e-tests/android/app/src/main/AndroidManifest.xml b/google-maps/e2e-tests/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 49f93cefd..000000000 --- a/google-maps/e2e-tests/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/google-maps/e2e-tests/android/app/src/main/assets/capacitor.config.json b/google-maps/e2e-tests/android/app/src/main/assets/capacitor.config.json deleted file mode 100644 index a22dfc2b9..000000000 --- a/google-maps/e2e-tests/android/app/src/main/assets/capacitor.config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "appId": "io.ionic.starter", - "appName": "e2e-tests", - "webDir": "build", - "bundledWebRuntime": false -} diff --git a/google-maps/e2e-tests/android/app/src/main/assets/capacitor.plugins.json b/google-maps/e2e-tests/android/app/src/main/assets/capacitor.plugins.json deleted file mode 100644 index 08a494550..000000000 --- a/google-maps/e2e-tests/android/app/src/main/assets/capacitor.plugins.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "pkg": "@capacitor/app", - "classpath": "com.capacitorjs.plugins.app.AppPlugin" - }, - { - "pkg": "@capacitor/google-maps", - "classpath": "com.capacitorjs.plugins.googlemaps.CapacitorGoogleMapsPlugin" - }, - { - "pkg": "@capacitor/haptics", - "classpath": "com.capacitorjs.plugins.haptics.HapticsPlugin" - }, - { - "pkg": "@capacitor/keyboard", - "classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin" - }, - { - "pkg": "@capacitor/status-bar", - "classpath": "com.capacitorjs.plugins.statusbar.StatusBarPlugin" - } -] diff --git a/google-maps/e2e-tests/android/app/src/main/java/io/ionic/starter/MainActivity.java b/google-maps/e2e-tests/android/app/src/main/java/io/ionic/starter/MainActivity.java deleted file mode 100644 index 73e3a98d4..000000000 --- a/google-maps/e2e-tests/android/app/src/main/java/io/ionic/starter/MainActivity.java +++ /dev/null @@ -1,5 +0,0 @@ -package io.ionic.starter; - -import com.getcapacitor.BridgeActivity; - -public class MainActivity extends BridgeActivity {} diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-land-hdpi/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable-land-hdpi/splash.png deleted file mode 100644 index e31573b4f..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable-land-hdpi/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-land-mdpi/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable-land-mdpi/splash.png deleted file mode 100644 index f7a64923e..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable-land-mdpi/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-land-xhdpi/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable-land-xhdpi/splash.png deleted file mode 100644 index 807725501..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable-land-xhdpi/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-land-xxhdpi/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable-land-xxhdpi/splash.png deleted file mode 100644 index 14c6c8fe3..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable-land-xxhdpi/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-land-xxxhdpi/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable-land-xxxhdpi/splash.png deleted file mode 100644 index 244ca2506..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable-land-xxxhdpi/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-port-hdpi/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable-port-hdpi/splash.png deleted file mode 100644 index 74faaa583..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable-port-hdpi/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-port-mdpi/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable-port-mdpi/splash.png deleted file mode 100644 index e944f4ad4..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable-port-mdpi/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-port-xhdpi/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable-port-xhdpi/splash.png deleted file mode 100644 index 564a82ff9..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable-port-xhdpi/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-port-xxhdpi/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable-port-xxhdpi/splash.png deleted file mode 100644 index bfabe6871..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable-port-xxhdpi/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-port-xxxhdpi/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable-port-xxxhdpi/splash.png deleted file mode 100644 index 692907126..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable-port-xxxhdpi/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/google-maps/e2e-tests/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index c7bd21dbd..000000000 --- a/google-maps/e2e-tests/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable/ic_launcher_background.xml b/google-maps/e2e-tests/android/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index d5fccc538..000000000 --- a/google-maps/e2e-tests/android/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/google-maps/e2e-tests/android/app/src/main/res/drawable/splash.png b/google-maps/e2e-tests/android/app/src/main/res/drawable/splash.png deleted file mode 100644 index f7a64923e..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/drawable/splash.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/layout/activity_main.xml b/google-maps/e2e-tests/android/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index b5ad13870..000000000 --- a/google-maps/e2e-tests/android/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/google-maps/e2e-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 036d09bc5..000000000 --- a/google-maps/e2e-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/google-maps/e2e-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 036d09bc5..000000000 --- a/google-maps/e2e-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index c023e5059..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png deleted file mode 100644 index 2127973b2..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index b441f37d6..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 72905b854..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png deleted file mode 100644 index 8ed0605c2..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 9502e47a2..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 4d1e07710..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index df0f15880..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 853db043d..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 6cdf97c11..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 2960cbb61..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index 8e3093a86..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 46de6e255..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index d2ea9abed..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index a40d73e9c..000000000 Binary files a/google-maps/e2e-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/google-maps/e2e-tests/android/app/src/main/res/values/ic_launcher_background.xml b/google-maps/e2e-tests/android/app/src/main/res/values/ic_launcher_background.xml deleted file mode 100644 index c5d5899fd..000000000 --- a/google-maps/e2e-tests/android/app/src/main/res/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - \ No newline at end of file diff --git a/google-maps/e2e-tests/android/app/src/main/res/values/strings.xml b/google-maps/e2e-tests/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 9128e1571..000000000 --- a/google-maps/e2e-tests/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - e2e-tests - e2e-tests - io.ionic.starter - io.ionic.starter - diff --git a/google-maps/e2e-tests/android/app/src/main/res/values/styles.xml b/google-maps/e2e-tests/android/app/src/main/res/values/styles.xml deleted file mode 100644 index be874e54a..000000000 --- a/google-maps/e2e-tests/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/google-maps/e2e-tests/android/app/src/main/res/xml/config.xml b/google-maps/e2e-tests/android/app/src/main/res/xml/config.xml deleted file mode 100644 index 1b1b0e0dc..000000000 --- a/google-maps/e2e-tests/android/app/src/main/res/xml/config.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/google-maps/e2e-tests/android/app/src/main/res/xml/file_paths.xml b/google-maps/e2e-tests/android/app/src/main/res/xml/file_paths.xml deleted file mode 100644 index bd0c4d80d..000000000 --- a/google-maps/e2e-tests/android/app/src/main/res/xml/file_paths.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/google-maps/e2e-tests/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java b/google-maps/e2e-tests/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java deleted file mode 100644 index 029732784..000000000 --- a/google-maps/e2e-tests/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.getcapacitor.myapp; - -import static org.junit.Assert.*; - -import org.junit.Test; - -/** - * Example local unit test, which will execute on the development machine (host). - * - * @see Testing documentation - */ -public class ExampleUnitTest { - - @Test - public void addition_isCorrect() throws Exception { - assertEquals(4, 2 + 2); - } -} diff --git a/google-maps/e2e-tests/android/build.gradle b/google-maps/e2e-tests/android/build.gradle deleted file mode 100644 index c4b4ad0f2..000000000 --- a/google-maps/e2e-tests/android/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.0.0' - classpath 'com.google.gms:google-services:4.3.15' - classpath 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -apply from: "variables.gradle" - -allprojects { - repositories { - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/google-maps/e2e-tests/android/capacitor.settings.gradle b/google-maps/e2e-tests/android/capacitor.settings.gradle deleted file mode 100644 index a0346a2fb..000000000 --- a/google-maps/e2e-tests/android/capacitor.settings.gradle +++ /dev/null @@ -1,18 +0,0 @@ -// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN -include ':capacitor-android' -project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') - -include ':capacitor-app' -project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android') - -include ':capacitor-google-maps' -project(':capacitor-google-maps').projectDir = new File('../../android') - -include ':capacitor-haptics' -project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android') - -include ':capacitor-keyboard' -project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android') - -include ':capacitor-status-bar' -project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android') diff --git a/google-maps/e2e-tests/android/gradle.properties b/google-maps/e2e-tests/android/gradle.properties deleted file mode 100644 index 92710f31d..000000000 --- a/google-maps/e2e-tests/android/gradle.properties +++ /dev/null @@ -1,23 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx1536m - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -# AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app's APK -# https://developer.android.com/topic/libraries/support-library/androidx-rn -android.useAndroidX=true - diff --git a/google-maps/e2e-tests/android/gradle/wrapper/gradle-wrapper.jar b/google-maps/e2e-tests/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index ccebba771..000000000 Binary files a/google-maps/e2e-tests/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/google-maps/e2e-tests/android/gradle/wrapper/gradle-wrapper.properties b/google-maps/e2e-tests/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 761b8f088..000000000 --- a/google-maps/e2e-tests/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip -networkTimeout=10000 -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/google-maps/e2e-tests/android/gradlew b/google-maps/e2e-tests/android/gradlew deleted file mode 100755 index 79a61d421..000000000 --- a/google-maps/e2e-tests/android/gradlew +++ /dev/null @@ -1,244 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/google-maps/e2e-tests/android/gradlew.bat b/google-maps/e2e-tests/android/gradlew.bat deleted file mode 100644 index 6689b85be..000000000 --- a/google-maps/e2e-tests/android/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/google-maps/e2e-tests/android/settings.gradle b/google-maps/e2e-tests/android/settings.gradle deleted file mode 100644 index 3b4431d77..000000000 --- a/google-maps/e2e-tests/android/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -include ':app' -include ':capacitor-cordova-android-plugins' -project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/') - -apply from: 'capacitor.settings.gradle' \ No newline at end of file diff --git a/google-maps/e2e-tests/android/variables.gradle b/google-maps/e2e-tests/android/variables.gradle deleted file mode 100644 index c5ad4065a..000000000 --- a/google-maps/e2e-tests/android/variables.gradle +++ /dev/null @@ -1,16 +0,0 @@ -ext { - minSdkVersion = 22 - compileSdkVersion = 33 - targetSdkVersion = 33 - androidxActivityVersion = '1.7.0' - androidxAppCompatVersion = '1.6.1' - androidxCoordinatorLayoutVersion = '1.2.0' - androidxCoreVersion = '1.10.0' - androidxFragmentVersion = '1.5.6' - androidxWebkitVersion = '1.6.1' - androidxJunitVersion = '1.1.5' - androidxEspressoCoreVersion = '3.5.1' - cordovaAndroidVersion = '10.1.1' - coreSplashScreenVersion = '1.0.0' - junitVersion = '4.13.2' -} \ No newline at end of file diff --git a/google-maps/e2e-tests/capacitor.config.json b/google-maps/e2e-tests/capacitor.config.json deleted file mode 100644 index a22dfc2b9..000000000 --- a/google-maps/e2e-tests/capacitor.config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "appId": "io.ionic.starter", - "appName": "e2e-tests", - "webDir": "build", - "bundledWebRuntime": false -} diff --git a/google-maps/e2e-tests/ionic.config.json b/google-maps/e2e-tests/ionic.config.json deleted file mode 100644 index 43bec2727..000000000 --- a/google-maps/e2e-tests/ionic.config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "e2e-tests", - "integrations": { - "capacitor": {} - }, - "type": "react" -} diff --git a/google-maps/e2e-tests/ionic.e2e.config.ts b/google-maps/e2e-tests/ionic.e2e.config.ts deleted file mode 100644 index 4912652cb..000000000 --- a/google-maps/e2e-tests/ionic.e2e.config.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* eslint-disable import/no-anonymous-default-export */ -export default { - appRootDir: '.', - wdio: { - logLevel: 'trace', // options are "trace" or "error" - 'ios:simulator': { - 'appium:platformName': 'iOS', - 'appium:deviceName': 'iPhone 13 Pro Max', - 'appium:platformVersion': '15.2', - 'appium:isHeadless': true, - 'appium:wdaLaunchTimeout': 600000, - }, - 'ios:device': {}, - 'android:emulator': { - 'appium:platformName': 'Android', - 'appium:deviceName': 'e2eDevice', - 'appium:avd': 'e2eDevice', - 'appium:isHeadless': true, - 'appium:platformVersion': '11.0', - 'appium:appPackage': 'io.ionic.starter', - 'appium:appWaitActivity': 'io.ionic.starter.MainActivity', - 'appium:autoGrantPermissions': true, - 'appium:allowTestPackages': true, - 'appium:appWaitDuration': 60000, - 'appium:adbExecTimeout': 300000, - 'appium:deviceReadyTimeout': 3000, - 'appium:androidDeviceReadyTimeout': 3000, - 'appium:avdLaunchTimeout': 300000, - 'appium:avdReadyTimeout': 300000, - 'appium:appWaitForLaunch': false, - 'appium:newCommandTimeout': 300, - 'appium:avdArgs': '-no-window -noaudio -verbose -accel on -no-boot-anim -no-snapshot-save', - }, - 'android:device': {}, - }, -}; diff --git a/google-maps/e2e-tests/ios/.gitignore b/google-maps/e2e-tests/ios/.gitignore deleted file mode 100644 index 01ad52029..000000000 --- a/google-maps/e2e-tests/ios/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -App/build -App/Pods -App/App/public -DerivedData -xcuserdata - -# Cordova plugins for Capacitor -capacitor-cordova-ios-plugins - diff --git a/google-maps/e2e-tests/ios/App/App.xcodeproj/project.pbxproj b/google-maps/e2e-tests/ios/App/App.xcodeproj/project.pbxproj deleted file mode 100644 index e584de363..000000000 --- a/google-maps/e2e-tests/ios/App/App.xcodeproj/project.pbxproj +++ /dev/null @@ -1,420 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 48; - objects = { - -/* Begin PBXBuildFile section */ - 2FAD9763203C412B000D30F8 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2FAD9762203C412B000D30F8 /* config.xml */; }; - 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */ = {isa = PBXBuildFile; fileRef = 50379B222058CBB4000EE86E /* capacitor.config.json */; }; - 504EC3081FED79650016851F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504EC3071FED79650016851F /* AppDelegate.swift */; }; - 504EC30D1FED79650016851F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30B1FED79650016851F /* Main.storyboard */; }; - 504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; }; - 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; }; - 50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; }; - A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = ""; }; - 50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = ""; }; - 504EC3041FED79650016851F /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 504EC3071FED79650016851F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 504EC30C1FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = ""; }; - AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.release.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig"; sourceTree = ""; }; - FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 504EC3011FED79650016851F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 27E2DDA53C4D2A4D1A88CE4A /* Frameworks */ = { - isa = PBXGroup; - children = ( - AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 504EC2FB1FED79650016851F = { - isa = PBXGroup; - children = ( - 504EC3061FED79650016851F /* App */, - 504EC3051FED79650016851F /* Products */, - 7F8756D8B27F46E3366F6CEA /* Pods */, - 27E2DDA53C4D2A4D1A88CE4A /* Frameworks */, - ); - sourceTree = ""; - }; - 504EC3051FED79650016851F /* Products */ = { - isa = PBXGroup; - children = ( - 504EC3041FED79650016851F /* App.app */, - ); - name = Products; - sourceTree = ""; - }; - 504EC3061FED79650016851F /* App */ = { - isa = PBXGroup; - children = ( - 50379B222058CBB4000EE86E /* capacitor.config.json */, - 504EC3071FED79650016851F /* AppDelegate.swift */, - 504EC30B1FED79650016851F /* Main.storyboard */, - 504EC30E1FED79650016851F /* Assets.xcassets */, - 504EC3101FED79650016851F /* LaunchScreen.storyboard */, - 504EC3131FED79650016851F /* Info.plist */, - 2FAD9762203C412B000D30F8 /* config.xml */, - 50B271D01FEDC1A000F3C39B /* public */, - ); - path = App; - sourceTree = ""; - }; - 7F8756D8B27F46E3366F6CEA /* Pods */ = { - isa = PBXGroup; - children = ( - FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */, - AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 504EC3031FED79650016851F /* App */ = { - isa = PBXNativeTarget; - buildConfigurationList = 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */; - buildPhases = ( - 6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */, - 504EC3001FED79650016851F /* Sources */, - 504EC3011FED79650016851F /* Frameworks */, - 504EC3021FED79650016851F /* Resources */, - 9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */, - 1EB4CF9A9223BA57362D699F /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = App; - productName = App; - productReference = 504EC3041FED79650016851F /* App.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 504EC2FC1FED79650016851F /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 0920; - TargetAttributes = { - 504EC3031FED79650016851F = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */; - compatibilityVersion = "Xcode 8.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 504EC2FB1FED79650016851F; - productRefGroup = 504EC3051FED79650016851F /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 504EC3031FED79650016851F /* App */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 504EC3021FED79650016851F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */, - 50B271D11FEDC1A000F3C39B /* public in Resources */, - 504EC30F1FED79650016851F /* Assets.xcassets in Resources */, - 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */, - 504EC30D1FED79650016851F /* Main.storyboard in Resources */, - 2FAD9763203C412B000D30F8 /* config.xml in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 1EB4CF9A9223BA57362D699F /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-App-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 504EC3001FED79650016851F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 504EC3081FED79650016851F /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 504EC30B1FED79650016851F /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 504EC30C1FED79650016851F /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 504EC3101FED79650016851F /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 504EC3111FED79650016851F /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 504EC3141FED79650016851F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 504EC3151FED79650016851F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 504EC3171FED79650016851F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 9YN2HU59K8; - INFOPLIST_FILE = App/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; - PRODUCT_BUNDLE_IDENTIFIER = io.ionic.googlemaps; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 504EC3181FED79650016851F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 9YN2HU59K8; - INFOPLIST_FILE = App/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = io.ionic.googlemaps; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 504EC3141FED79650016851F /* Debug */, - 504EC3151FED79650016851F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 504EC3171FED79650016851F /* Debug */, - 504EC3181FED79650016851F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 504EC2FC1FED79650016851F /* Project object */; -} diff --git a/google-maps/e2e-tests/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/google-maps/e2e-tests/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 42daef8a1..000000000 --- a/google-maps/e2e-tests/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/google-maps/e2e-tests/ios/App/App.xcworkspace/contents.xcworkspacedata b/google-maps/e2e-tests/ios/App/App.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index b301e824b..000000000 --- a/google-maps/e2e-tests/ios/App/App.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/google-maps/e2e-tests/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/google-maps/e2e-tests/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/google-maps/e2e-tests/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/google-maps/e2e-tests/ios/App/App/AppDelegate.swift b/google-maps/e2e-tests/ios/App/App/AppDelegate.swift deleted file mode 100644 index 53e376039..000000000 --- a/google-maps/e2e-tests/ios/App/App/AppDelegate.swift +++ /dev/null @@ -1,60 +0,0 @@ -import UIKit -import Capacitor - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { - // Called when the app was launched with a url. Feel free to add additional processing here, - // but if you want the App API to support tracking app url opens, make sure to keep this call - return ApplicationDelegateProxy.shared.application(app, open: url, options: options) - } - - func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { - // Called when the app was launched with an activity, including Universal Links. - // Feel free to add additional processing here, but if you want the App API to support - // tracking app url opens, make sure to keep this call - return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler) - } - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - super.touchesBegan(touches, with: event) - - let statusBarRect = UIApplication.shared.statusBarFrame - guard let touchPoint = event?.allTouches?.first?.location(in: self.window) else { return } - - if statusBarRect.contains(touchPoint) { - NotificationCenter.default.post(name: .capacitorStatusBarTapped, object: nil) - } - } - -} diff --git a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/google-maps/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png deleted file mode 100644 index adf6ba01d..000000000 Binary files a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png and /dev/null differ diff --git a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/google-maps/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 905798df6..000000000 --- a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "images" : [ - { - "filename" : "AppIcon-512@2x.png", - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} \ No newline at end of file diff --git a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Contents.json b/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json b/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json deleted file mode 100644 index d7d96a67c..000000000 --- a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "splash-2732x2732-2.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "splash-2732x2732-1.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "splash-2732x2732.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png b/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png deleted file mode 100644 index 33ea6c970..000000000 Binary files a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png and /dev/null differ diff --git a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png b/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png deleted file mode 100644 index 33ea6c970..000000000 Binary files a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png and /dev/null differ diff --git a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png b/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png deleted file mode 100644 index 33ea6c970..000000000 Binary files a/google-maps/e2e-tests/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png and /dev/null differ diff --git a/google-maps/e2e-tests/ios/App/App/Base.lproj/LaunchScreen.storyboard b/google-maps/e2e-tests/ios/App/App/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index e7ae5d780..000000000 --- a/google-maps/e2e-tests/ios/App/App/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/google-maps/e2e-tests/ios/App/App/Base.lproj/Main.storyboard b/google-maps/e2e-tests/ios/App/App/Base.lproj/Main.storyboard deleted file mode 100644 index b44df7be8..000000000 --- a/google-maps/e2e-tests/ios/App/App/Base.lproj/Main.storyboard +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/google-maps/e2e-tests/ios/App/App/Info.plist b/google-maps/e2e-tests/ios/App/App/Info.plist deleted file mode 100644 index 578b0a476..000000000 --- a/google-maps/e2e-tests/ios/App/App/Info.plist +++ /dev/null @@ -1,56 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - e2e-tests - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - NSLocationWhenInUseUsageDescription - Using Test App Location - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/google-maps/e2e-tests/ios/App/App/capacitor.config.json b/google-maps/e2e-tests/ios/App/App/capacitor.config.json deleted file mode 100644 index a22dfc2b9..000000000 --- a/google-maps/e2e-tests/ios/App/App/capacitor.config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "appId": "io.ionic.starter", - "appName": "e2e-tests", - "webDir": "build", - "bundledWebRuntime": false -} diff --git a/google-maps/e2e-tests/ios/App/App/config.xml b/google-maps/e2e-tests/ios/App/App/config.xml deleted file mode 100644 index 1b1b0e0dc..000000000 --- a/google-maps/e2e-tests/ios/App/App/config.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/google-maps/e2e-tests/ios/App/Podfile b/google-maps/e2e-tests/ios/App/Podfile deleted file mode 100644 index a67b0a85f..000000000 --- a/google-maps/e2e-tests/ios/App/Podfile +++ /dev/null @@ -1,22 +0,0 @@ -platform :ios, '13.0' -use_frameworks! - -# workaround to avoid Xcode caching of Pods that requires -# Product -> Clean Build Folder after new Cordova plugins installed -# Requires CocoaPods 1.6 or newer -install! 'cocoapods', :disable_input_output_paths => true - -def capacitor_pods - pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' - pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' - pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app' - pod 'CapacitorGoogleMaps', :path => '../../..' - pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics' - pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard' - pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar' -end - -target 'App' do - capacitor_pods - # Add your Pods here -end diff --git a/google-maps/e2e-tests/package.json b/google-maps/e2e-tests/package.json deleted file mode 100644 index e32018126..000000000 --- a/google-maps/e2e-tests/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "e2e-tests", - "version": "0.0.1", - "private": true, - "dependencies": { - "@capacitor/android": "^5.0.0", - "@capacitor/app": "^5.0.0", - "@capacitor/core": "^5.0.0", - "@capacitor/google-maps": "file:..", - "@capacitor/haptics": "^5.0.0", - "@capacitor/ios": "^5.0.0", - "@capacitor/keyboard": "^5.0.0", - "@capacitor/status-bar": "^5.0.0", - "@ionic/react": "^6.0.0", - "@ionic/react-router": "^6.0.0", - "@testing-library/jest-dom": "^5.11.9", - "@testing-library/react": "^11.2.5", - "@testing-library/user-event": "^12.6.3", - "@types/jest": "^26.0.20", - "@types/node": "^12.19.15", - "@types/react": "^16.14.3", - "@types/react-dom": "^16.9.10", - "@types/react-router": "^5.1.11", - "@types/react-router-dom": "^5.1.7", - "ionicons": "^5.4.0", - "react": "^17.0.1", - "react-dom": "^17.0.1", - "react-router": "^5.2.0", - "react-router-dom": "^5.2.0", - "react-scripts": "^5.0.0", - "typescript": "^4.1.3", - "web-vitals": "^0.2.4", - "workbox-background-sync": "^5.1.4", - "workbox-broadcast-update": "^5.1.4", - "workbox-cacheable-response": "^5.1.4", - "workbox-core": "^5.1.4", - "workbox-expiration": "^5.1.4", - "workbox-google-analytics": "^5.1.4", - "workbox-navigation-preload": "^5.1.4", - "workbox-precaching": "^5.1.4", - "workbox-range-requests": "^5.1.4", - "workbox-routing": "^5.1.4", - "workbox-strategies": "^5.1.4", - "workbox-streams": "^5.1.4" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons)/)'", - "eject": "react-scripts eject", - "sync": "npm run build && npx cap sync", - "ionic-e2e": "ionic-e2e", - "e2e:ios:build": "npm run ionic-e2e build ios:simulator", - "e2e:ios:run": "npm run ionic-e2e run ios:simulator", - "e2e:ios": "E2E_MODE=simulator && npm run sync && npm run e2e:ios:build && npm run e2e:ios:run", - "e2e:android:build": "npm run ionic-e2e build android:emulator", - "e2e:android:run": "npm run ionic-e2e run android:emulator", - "e2e:android": "./scripts/run_Android_E2E.sh", - "e2e:prepare": "./scripts/build_local_package.sh" - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "@capacitor/cli": "^5.0.0", - "@ionic/e2e": "0.2.0-next.6", - "@ionic/e2e-components-ionic": "0.2.0-next.6", - "appium": "^1.22.1" - }, - "description": "An Ionic project" -} diff --git a/google-maps/e2e-tests/public/assets/icon/favicon.png b/google-maps/e2e-tests/public/assets/icon/favicon.png deleted file mode 100644 index 51888a7bb..000000000 Binary files a/google-maps/e2e-tests/public/assets/icon/favicon.png and /dev/null differ diff --git a/google-maps/e2e-tests/public/assets/icon/icon.png b/google-maps/e2e-tests/public/assets/icon/icon.png deleted file mode 100644 index a7f63748a..000000000 Binary files a/google-maps/e2e-tests/public/assets/icon/icon.png and /dev/null differ diff --git a/google-maps/e2e-tests/public/assets/icon/marker.svg b/google-maps/e2e-tests/public/assets/icon/marker.svg deleted file mode 100644 index d935e94c4..000000000 --- a/google-maps/e2e-tests/public/assets/icon/marker.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/google-maps/e2e-tests/public/assets/icon/pin.png b/google-maps/e2e-tests/public/assets/icon/pin.png deleted file mode 100644 index adc3a413c..000000000 Binary files a/google-maps/e2e-tests/public/assets/icon/pin.png and /dev/null differ diff --git a/google-maps/e2e-tests/public/assets/shapes.svg b/google-maps/e2e-tests/public/assets/shapes.svg deleted file mode 100644 index d370b4dcc..000000000 --- a/google-maps/e2e-tests/public/assets/shapes.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/google-maps/e2e-tests/public/index.html b/google-maps/e2e-tests/public/index.html deleted file mode 100644 index 25b753b06..000000000 --- a/google-maps/e2e-tests/public/index.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Ionic App - - - - - - - - - - - - - - - - - - - -
- - - diff --git a/google-maps/e2e-tests/public/manifest.json b/google-maps/e2e-tests/public/manifest.json deleted file mode 100644 index 580870547..000000000 --- a/google-maps/e2e-tests/public/manifest.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "short_name": "Ionic App", - "name": "My Ionic App", - "icons": [ - { - "src": "assets/icon/favicon.png", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "assets/icon/icon.png", - "type": "image/png", - "sizes": "512x512", - "purpose": "maskable" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#ffffff", - "background_color": "#ffffff" -} diff --git a/google-maps/e2e-tests/scripts/build_local_package.sh b/google-maps/e2e-tests/scripts/build_local_package.sh deleted file mode 100755 index bb97fa3b8..000000000 --- a/google-maps/e2e-tests/scripts/build_local_package.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cd ../ && npm install && npm run pack-local -cd ./e2e-tests && npm install ../capacitor-google-maps.tgz \ No newline at end of file diff --git a/google-maps/e2e-tests/scripts/create_E2E_AVD.sh b/google-maps/e2e-tests/scripts/create_E2E_AVD.sh deleted file mode 100755 index 3cbbb5c24..000000000 --- a/google-maps/e2e-tests/scripts/create_E2E_AVD.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -CPU_ARCH=`uname -p`"" - -SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager -AVDMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager -ABD=$ANDROID_SDK_ROOT/platform-tools/adb -EMU=$ANDROID_SDK_ROOT/emulator/emulator - -E2E_DEVICE_EXISTS=`${EMU} -list-avds | grep -c e2eDevice` - -if [[ $E2E_DEVICE_EXISTS -lt 1 ]]; then - echo "Creating e2eDevice AVD..." - echo "" - - echo "CPU_ARCH: $CPU_ARCH" - echo "JAVA_HOME: $JAVA_HOME" - echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT" - echo "" - echo "--------------------------" - echo "" - - echo "Accepting Lics..." - sh -c \yes | ${SDKMANAGER} --licenses > /dev/null - - echo "Installing build-tools..." - ${SDKMANAGER} --install 'build-tools;31.0.0' platform-tools 'platforms;android-31' - echo "Installing emulator..." - ${SDKMANAGER} --install emulator --channel=0 - echo "Installing sys-image..." - - # If we are on arm (m1 mac) use arm images, else use x86_64 - if [ "$CPU_ARCH" = "arm" ]; then - ${SDKMANAGER} --install 'system-images;android-31;google_apis;arm64-v8a' --channel=0 - else - ${SDKMANAGER} --install 'system-images;android-31;google_apis;x86_64' --channel=0 - fi - - echo "Killing all running emulators..." - ${ABD} devices | grep emulator | cut -f1 | while read line; do ${ABD} -s $line emu kill; done; - - echo "Creating AVD..." - if [ "$CPU_ARCH" = "arm" ]; then - ${AVDMANAGER} --verbose create avd -n e2eDevice -k "system-images;android-31;google_apis;arm64-v8a" --device "pixel_3a" - else - ${AVDMANAGER} --verbose create avd -n e2eDevice -k "system-images;android-31;google_apis;x86_64" --device "pixel_3a" - fi - -else - echo "e2eDevice AVD exists!" -fi - -echo "" - - diff --git a/google-maps/e2e-tests/scripts/run_Android_E2E.sh b/google-maps/e2e-tests/scripts/run_Android_E2E.sh deleted file mode 100755 index b61184b1e..000000000 --- a/google-maps/e2e-tests/scripts/run_Android_E2E.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -set -e - -if [[ -z "$ANDROID_SDK_ROOT" ]]; then - export ANDROID_SDK_ROOT=~/Library/Android/sdk -fi -if [[ -n "$JAVA_HOME_11_X64" ]]; then - export JAVA_HOME=$JAVA_HOME_11_X64 -else - export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home -fi - -# Check to see if we are not in a Github Action -if [[ -z $GITHUB_ACTION ]]; then - - ABD=$ANDROID_SDK_ROOT/platform-tools/adb - EMU=$ANDROID_SDK_ROOT/emulator/emulator - - echo "Not in GH Action. Checking for e2eDevice Emulator..." - $PWD/scripts/create_E2E_AVD.sh - - set +e - - echo 'Searching for e2eDevice...' - devicesCount=`${ABD} devices | grep -c emulator` - - if [[ $devicesCount =~ 0 ]]; then - echo 'Starting emulator...' - ${EMU} -avd "e2eDevice" -no-window -noaudio -accel on -no-boot-anim -no-snapshot-save & - fi - - bootanim="" - failcounter=0 - timeout_in_sec=360 - - until [[ "$bootanim" =~ "stopped" ]]; do - bootanim=`${ABD} -e shell getprop init.svc.bootanim 2>&1 &` - if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline" - || "$bootanim" =~ "running" ]]; then - let "failcounter += 1" - echo "Waiting for emulator to start" - if [[ $failcounter -gt timeout_in_sec ]]; then - echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator" - exit 1 - fi - fi - sleep 1 - done - - echo "Emulator is ready" - - sleep 4 - - set -e - -fi - -E2E_MODE=simulator - -npm run sync -npm run e2e:android:build -npm run e2e:android:run diff --git a/google-maps/e2e-tests/src/App.test.tsx b/google-maps/e2e-tests/src/App.test.tsx deleted file mode 100644 index 8c927a8d7..000000000 --- a/google-maps/e2e-tests/src/App.test.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react'; -import { render } from '@testing-library/react'; -import App from './App'; - -test('renders without crashing', () => { - const { baseElement } = render(); - expect(baseElement).toBeDefined(); -}); diff --git a/google-maps/e2e-tests/src/App.tsx b/google-maps/e2e-tests/src/App.tsx deleted file mode 100644 index 43cd30b4e..000000000 --- a/google-maps/e2e-tests/src/App.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { IonApp, IonRouterOutlet, IonSplitPane, setupIonicReact } from '@ionic/react'; -import { IonReactRouter } from '@ionic/react-router'; -import { Redirect, Route } from 'react-router-dom'; -import Menu from './components/Menu'; - -/* Core CSS required for Ionic components to work properly */ -import '@ionic/react/css/core.css'; - -/* Basic CSS for apps built with Ionic */ -import '@ionic/react/css/normalize.css'; -import '@ionic/react/css/structure.css'; -import '@ionic/react/css/typography.css'; - -/* Optional CSS utils that can be commented out */ -import '@ionic/react/css/padding.css'; -import '@ionic/react/css/float-elements.css'; -import '@ionic/react/css/text-alignment.css'; -import '@ionic/react/css/text-transformation.css'; -import '@ionic/react/css/flex-utils.css'; -import '@ionic/react/css/display.css'; - -/* Theme variables */ -import './theme/variables.css'; - -import { getRouterSetup } from './routes'; -import Home from './pages/Home'; - -setupIonicReact(); - -const App: React.FC = () => { - const routes = getRouterSetup(); - - return ( - - - - - - - - - - - - {routes.map((route, idx) => { - return ( - - - - ); - })} - - - - - ); -}; - -export default App; diff --git a/google-maps/e2e-tests/src/components/BaseTestingPage.tsx b/google-maps/e2e-tests/src/components/BaseTestingPage.tsx deleted file mode 100644 index cce706faa..000000000 --- a/google-maps/e2e-tests/src/components/BaseTestingPage.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { IonButtons, IonContent, IonHeader, IonMenuButton, IonPage, IonTitle, IonToolbar } from '@ionic/react'; - -const BaseTestingPage: React.FC<{ children?: React.ReactNode; pageTitle: string }> = ({ children, pageTitle }) => { - return ( - - - - - - - {pageTitle} - - - - - - {pageTitle} - - - {children} - - - ); -}; - -export default BaseTestingPage; diff --git a/google-maps/e2e-tests/src/components/Menu.css b/google-maps/e2e-tests/src/components/Menu.css deleted file mode 100644 index f435049ab..000000000 --- a/google-maps/e2e-tests/src/components/Menu.css +++ /dev/null @@ -1,114 +0,0 @@ -ion-menu ion-content { - --background: var(--ion-item-background, var(--ion-background-color, #fff)); -} - -ion-menu.md ion-content { - --padding-start: 8px; - --padding-end: 8px; - --padding-top: 20px; - --padding-bottom: 20px; -} - -ion-menu.md ion-list { - padding: 20px 0; -} - -ion-menu.md ion-note { - margin-bottom: 30px; -} - -ion-menu.md ion-list-header, -ion-menu.md ion-note { - padding-left: 10px; -} - -ion-menu.md ion-list#inbox-list { - border-bottom: 1px solid var(--ion-color-step-150, #d7d8da); -} - -ion-menu.md ion-list#inbox-list ion-list-header { - font-size: 22px; - font-weight: 600; - min-height: 20px; -} - -ion-menu.md ion-list#labels-list ion-list-header { - font-size: 16px; - margin-bottom: 18px; - color: #757575; - min-height: 26px; -} - -ion-menu.md ion-item { - --padding-start: 10px; - --padding-end: 10px; - border-radius: 4px; -} - -ion-menu.md ion-item.selected { - --background: rgba(var(--ion-color-primary-rgb), 0.14); -} - -ion-menu.md ion-item.selected ion-icon { - color: var(--ion-color-primary); -} - -ion-menu.md ion-item ion-icon { - color: #616e7e; -} - -ion-menu.md ion-item ion-label { - font-weight: 500; -} - -ion-menu.ios ion-content { - --padding-bottom: 20px; -} - -ion-menu.ios ion-list { - padding: 20px 0 0 0; -} - -ion-menu.ios ion-note { - line-height: 24px; - margin-bottom: 20px; -} - -ion-menu.ios ion-item { - --padding-start: 16px; - --padding-end: 16px; - --min-height: 50px; -} - -ion-menu.ios ion-item ion-icon { - font-size: 24px; - color: #73849a; -} - -ion-menu.ios ion-item .selected ion-icon { - color: var(--ion-color-primary); -} - -ion-menu.ios ion-list#labels-list ion-list-header { - margin-bottom: 8px; -} - -ion-menu.ios ion-list-header, -ion-menu.ios ion-note { - padding-left: 16px; - padding-right: 16px; -} - -ion-menu.ios ion-note { - margin-bottom: 8px; -} - -ion-note { - display: inline-block; - font-size: 16px; - color: var(--ion-color-medium-shade); -} - -ion-item.selected { - --color: var(--ion-color-primary); -} diff --git a/google-maps/e2e-tests/src/components/Menu.tsx b/google-maps/e2e-tests/src/components/Menu.tsx deleted file mode 100644 index 92351ff0f..000000000 --- a/google-maps/e2e-tests/src/components/Menu.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { IonContent, IonIcon, IonItem, IonLabel, IonList, IonListHeader, IonMenu, IonMenuToggle } from '@ionic/react'; -import { useLocation } from 'react-router-dom'; -import './Menu.css'; -import { useEffect, useState } from 'react'; -import { getMenuList, RouteGroup } from '../routes'; -import { homeOutline } from 'ionicons/icons'; - -const Menu: React.FC = () => { - const location = useLocation(); - const [menu, setMenu] = useState([]); - - useEffect(() => { - setMenu(getMenuList()); - }, []); - - return ( - - - - - - - Home - - - - {menu.map((routeGroup, indx) => { - return ( - - {routeGroup.groupName} - {routeGroup.pages.map((routeDescription, index) => { - return ( - - - - {routeDescription.title} - - - ); - })} - - ); - })} - - - ); -}; - -export default Menu; diff --git a/google-maps/e2e-tests/src/index.tsx b/google-maps/e2e-tests/src/index.tsx deleted file mode 100644 index c421f457b..000000000 --- a/google-maps/e2e-tests/src/index.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; -import * as serviceWorkerRegistration from './serviceWorkerRegistration'; -import reportWebVitals from './reportWebVitals'; - -ReactDOM.render( - - - , - document.getElementById('root') -); - -// If you want your app to work offline and load faster, you can change -// unregister() to register() below. Note this comes with some pitfalls. -// Learn more about service workers: https://cra.link/PWA -serviceWorkerRegistration.unregister(); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/google-maps/e2e-tests/src/pages/Drawing/Circles.tsx b/google-maps/e2e-tests/src/pages/Drawing/Circles.tsx deleted file mode 100644 index 466f7b2f7..000000000 --- a/google-maps/e2e-tests/src/pages/Drawing/Circles.tsx +++ /dev/null @@ -1,190 +0,0 @@ -import { IonButton, IonTextarea } from '@ionic/react'; -import { useState } from 'react'; -import { Circle, GoogleMap } from '@capacitor/google-maps'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const CircleMapPage: React.FC = () => { - const [map, setMap] = useState(); - const [commandOutput, setCommandOutput] = useState(''); - const [ids, setIds] = useState([]); - - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - const onCircleClick = (data: any) => { - setCommandOutput( - `CIRCLE (${data.circleId}) WAS CLICKED ON MAP (${data.mapId}) WITH TAG (${ - data.tag ?? '' - })`, - ); - }; - - const createMap = async () => { - setCommandOutput(''); - setMap(null); - try { - const mapRef = document.getElementById('map')!; - - const newMap = await GoogleMap.create({ - element: mapRef, - id: 'test-map', - apiKey: apiKey!, - config: { - center: { lat: 37.09, lng: -95.712 }, - zoom: 4, - }, - forceCreate: true, - }); - - setMap(newMap); - setCommandOutput('Map created'); - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const destroyMap = async () => { - setCommandOutput(''); - try { - if (map) { - await map.destroy(); - setMap(null); - setCommandOutput('Map destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const createCircle = async () => { - setCommandOutput(''); - try { - if (map) { - interface City { - center: google.maps.LatLngLiteral; - population: number; - } - - const citymap: Record = { - chicago: { - center: { lat: 41.878, lng: -87.629 }, - population: 2714856, - }, - newyork: { - center: { lat: 40.714, lng: -74.005 }, - population: 8405837, - }, - losangeles: { - center: { lat: 34.052, lng: -118.243 }, - population: 3857799, - }, - vancouver: { - center: { lat: 49.25, lng: -123.1 }, - population: 603502, - }, - }; - - const allCircles: Circle[] = []; - - for (const city in citymap) { - allCircles.push({ - strokeColor: '#FF0000', - strokeOpacity: 0.8, - strokeWeight: 2, - fillColor: '#FF0000', - fillOpacity: 0.35, - center: citymap[city].center, - radius: Math.sqrt(citymap[city].population) * 100, - tag: city, - title: city, - clickable: true, - }); - } - - const createdIds = await map.addCircles(allCircles); - - const newIds = createdIds.concat(ids); - setIds(newIds); - - setCommandOutput('Circles created'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const deleteCircle = async () => { - setCommandOutput(''); - try { - if (map) { - await map.removeCircles(ids); - setIds([]); - - setCommandOutput('Circles removed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const setOnCircleClickButton = async () => { - map?.setOnCircleClickListener(onCircleClick); - setCommandOutput('Set On Circle Click Listeners!'); - }; - - const removeOnCircleClickButton = async () => { - map?.setOnCircleClickListener(); - setCommandOutput('Removed On Circle Click Listeners!'); - }; - - return ( - -
- - Create Map - - - Destroy Map - - - Set Click Listeners - - - Remove Click Listeners - - - - Draw Circles - - - - Delete Circles - -
-
- -
- -
- ); -}; - -export default CircleMapPage; diff --git a/google-maps/e2e-tests/src/pages/Drawing/Polygons.tsx b/google-maps/e2e-tests/src/pages/Drawing/Polygons.tsx deleted file mode 100644 index e06bc6149..000000000 --- a/google-maps/e2e-tests/src/pages/Drawing/Polygons.tsx +++ /dev/null @@ -1,215 +0,0 @@ -import { IonButton, IonTextarea } from '@ionic/react'; -import { useState } from 'react'; -import { GoogleMap } from '@capacitor/google-maps'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const PolygonMapPage: React.FC = () => { - const [map, setMap] = useState(); - const [commandOutput, setCommandOutput] = useState(''); - const [ids, setIds] = useState([]); - - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - const onPolygonClick = (data: any) => { - setCommandOutput( - `POLYGON (${data.polygonId}) WAS CLICKED ON MAP (${ - data.mapId - }) WITH TAG (${data.tag ?? ''})`, - ); - }; - - const createMap = async () => { - setCommandOutput(''); - setMap(null); - try { - const mapRef = document.getElementById('map')!; - - const newMap = await GoogleMap.create({ - element: mapRef, - id: 'test-map', - apiKey: apiKey!, - config: { - center: { - lat: 24.886, - lng: -70.268, - }, - zoom: 5, - }, - forceCreate: true, - }); - - setMap(newMap); - setCommandOutput('Map created'); - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const destroyMap = async () => { - setCommandOutput(''); - try { - if (map) { - await map.destroy(); - setMap(null); - setCommandOutput('Map destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const createHollowPolygon = async () => { - setCommandOutput(''); - - try { - if (map) { - // hollow polygon outer shape - const outerCoords = [ - { lat: 25.774, lng: -80.19 }, - { lat: 18.466, lng: -66.118 }, - { lat: 32.321, lng: -64.757 }, - ]; - - // polygon hole shape - const innerCoords = [ - { lat: 28.745, lng: -70.579 }, - { lat: 29.57, lng: -67.514 }, - { lat: 27.339, lng: -66.668 }, - ]; - - const createdIds = await map.addPolygons([ - { - paths: [outerCoords, innerCoords], - strokeColor: '#FFC107', - strokeOpacity: 0.8, - strokeWeight: 2, - fillColor: '#FFC107', - fillOpacity: 0.35, - tag: 'my_test_hollow_polygon', - clickable: true, - }, - ]); - - const newIds = createdIds.concat(ids); - - setIds(newIds); - } - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const createPolygon = async () => { - setCommandOutput(''); - try { - if (map) { - const triangleCoords = [ - { lat: 25.774, lng: -80.19 }, - { lat: 18.466, lng: -66.118 }, - { lat: 32.321, lng: -64.757 }, - { lat: 25.774, lng: -80.19 }, - ]; - - const createdIds = await map.addPolygons([ - { - paths: triangleCoords, - strokeColor: '#FF0000', - strokeOpacity: 0.8, - strokeWeight: 2, - fillColor: '#FF0000', - fillOpacity: 0.35, - tag: 'my_test_polygon', - clickable: true, - }, - ]); - - const newIds = createdIds.concat(ids); - setIds(newIds); - - setCommandOutput('Polygons created'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const deletePolygon = async () => { - setCommandOutput(''); - try { - if (map) { - await map.removePolygons(ids); - setIds([]); - - setCommandOutput('Polygons removed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const setOnPolygonClickButton = async () => { - map?.setOnPolygonClickListener(onPolygonClick); - setCommandOutput('Set On Polygon Click Listeners!'); - }; - - const removeOnPolygonClickButton = async () => { - map?.setOnPolygonClickListener(); - setCommandOutput('Removed On Polygon Click Listeners!'); - }; - - return ( - -
- - Create Map - - - Destroy Map - - - Set Click Listeners - - - Remove Click Listeners - - - - Draw Polygon - - - - Draw Hollow Polygon - - - - Delete Polygons - -
-
- -
- -
- ); -}; - -export default PolygonMapPage; diff --git a/google-maps/e2e-tests/src/pages/Drawing/Polylines.tsx b/google-maps/e2e-tests/src/pages/Drawing/Polylines.tsx deleted file mode 100644 index be79ebba6..000000000 --- a/google-maps/e2e-tests/src/pages/Drawing/Polylines.tsx +++ /dev/null @@ -1,172 +0,0 @@ -import { IonButton, IonTextarea } from '@ionic/react'; -import { useState } from 'react'; -import { GoogleMap } from '@capacitor/google-maps'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const PolylineMapPage: React.FC = () => { - const [map, setMap] = useState(); - const [commandOutput, setCommandOutput] = useState(''); - const [ids, setIds] = useState([]); - - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - const onPolylineClick = (data: any) => { - setCommandOutput( - `POLYLINE (${data.polylineId}) WAS CLICKED ON MAP (${ - data.mapId - }) WITH TAG (${data.tag ?? ''})`, - ); - }; - - const createMap = async () => { - setCommandOutput(''); - setMap(null); - try { - const mapRef = document.getElementById('map')!; - - const newMap = await GoogleMap.create({ - element: mapRef, - id: 'test-map', - apiKey: apiKey!, - config: { - center: { - lat: 33.6, - lng: -117.9, - }, - zoom: 8, - }, - forceCreate: true, - }); - - setMap(newMap); - setCommandOutput('Map created'); - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const destroyMap = async () => { - setCommandOutput(''); - try { - if (map) { - await map.destroy(); - setMap(null); - setCommandOutput('Map destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const createPolyline = async () => { - setCommandOutput(''); - try { - if (map) { - const sampleLines: google.maps.LatLngLiteral[] = [ - { lat: 37.772, lng: -122.214 }, - { lat: 21.291, lng: -157.821 }, - { lat: -18.142, lng: 178.431 }, - { lat: -27.467, lng: 153.027 }, - ]; - - const createdIds = await map.addPolylines([ - { - path: sampleLines, - strokeColor: '#ffdd00', - strokeOpacity: 1.0, - strokeWeight: 2, - geodesic: true, - tag: 'my_polyline', - clickable: true, - styleSpans: [ - { color: '#85892D' }, - { color: '#0000FF' }, - { color: '#FFF700' }, - { color: '#FF99CC' }, - ], - }, - ]); - - setIds(createdIds); - - setCommandOutput('Polyline created'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const deletePolyline = async () => { - setCommandOutput(''); - try { - if (map) { - await map.removePolylines(ids); - setIds([]); - } - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const setOnPolylineClickButton = async () => { - map?.setOnPolylineClickListener(onPolylineClick); - setCommandOutput('Set On Polyline Click Listeners!'); - }; - - const removeOnPolylineClickButton = async () => { - map?.setOnPolylineClickListener(); - setCommandOutput('Removed On Polyline Click Listeners!'); - }; - - return ( - -
- - Create Map - - - Destroy Map - - - Set Click Listeners - - - Remove Click Listeners - - - - Draw Polyline - - - - Delete Polyline - -
-
- -
- -
- ); -}; - -export default PolylineMapPage; diff --git a/google-maps/e2e-tests/src/pages/Home.tsx b/google-maps/e2e-tests/src/pages/Home.tsx deleted file mode 100644 index ff61c2ff4..000000000 --- a/google-maps/e2e-tests/src/pages/Home.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import BaseTestingPage from '../components/BaseTestingPage'; - -const Home: React.FC = () => { - return ( - -

- Choose a testing page from the menu to get started! -

-
- ); -}; - -export default Home; diff --git a/google-maps/e2e-tests/src/pages/Map/Bounds.tsx b/google-maps/e2e-tests/src/pages/Map/Bounds.tsx deleted file mode 100644 index 5b8f7a80d..000000000 --- a/google-maps/e2e-tests/src/pages/Map/Bounds.tsx +++ /dev/null @@ -1,195 +0,0 @@ -import { useState } from 'react'; -import { GoogleMap, LatLngBounds } from '@capacitor/google-maps'; -import { - IonButton, - IonCol, - IonInput, - IonLabel, - IonRow, - IonTextarea, -} from '@ionic/react'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const BoundsMapPage: React.FC = () => { - const [map, setMap] = useState(); - const [commandOutput, setCommandOutput] = useState(''); - const [lat, setLat] = useState(0); - const [lng, setLng] = useState(0); - - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - async function createMap() { - setCommandOutput(''); - setMap(null); - try { - const mapRef = document.getElementById('map')!; - - const newMap = await GoogleMap.create({ - element: mapRef, - id: 'test-map', - apiKey: apiKey!, - config: { - center: { - lat: 33.6, - lng: -117.9, - }, - zoom: 8, - }, - forceCreate: true, - }); - - setMap(newMap); - setCommandOutput('Map created'); - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function destroyMap() { - setCommandOutput(''); - try { - if (map) { - await map.destroy(); - setMap(null); - setCommandOutput('Map destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function getBounds() { - setCommandOutput(''); - try { - const bounds = await map!.getMapBounds(); - setCommandOutput(JSON.stringify(bounds)); - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function fitBounds() { - setCommandOutput(''); - try { - const bounds = new LatLngBounds({ - southwest: { - lat: lat - 1, - lng: lng - 1, - }, - center: { - lat, - lng, - }, - northeast: { - lat: lat + 1, - lng: lng + 1, - }, - }); - await map!.fitBounds(bounds, 50); - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function boundsContainsPoint() { - setCommandOutput(''); - try { - const bounds = await map!.getMapBounds(); - const contains = await bounds.contains({ - lat, - lng, - }); - setCommandOutput(contains.toString()); - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function extendBounds() { - setCommandOutput(''); - try { - const bounds = await map!.getMapBounds(); - const newBounds = await bounds.extend({ - lat, - lng, - }); - setCommandOutput(JSON.stringify(newBounds)); - } catch (err: any) { - setCommandOutput(err.message); - } - } - - return ( - -
- - Create Map - - - Destroy Map - - - Get Bounds - - - Fit Bounds - - - - Lat - setLat(Number(e.detail.value!))} - > - - - Lng - setLng(Number(e.detail.value!))} - > - - - - Bounds Contains Point - - - Extend Bounds - - - -
-
- -
- -
- ); -}; - -export default BoundsMapPage; diff --git a/google-maps/e2e-tests/src/pages/Map/ConfigMap.tsx b/google-maps/e2e-tests/src/pages/Map/ConfigMap.tsx deleted file mode 100644 index b73b65e2f..000000000 --- a/google-maps/e2e-tests/src/pages/Map/ConfigMap.tsx +++ /dev/null @@ -1,267 +0,0 @@ -import { useState } from 'react'; -import { GoogleMap } from '@capacitor/google-maps'; -import { MapType } from '@capacitor/google-maps'; -import { IonButton, IonTextarea } from '@ionic/react'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const ConfigMapPage: React.FC = () => { - const [maps, setMaps] = useState([]); - const [commandOutput, setCommandOutput] = useState(''); - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - - async function createMaps() { - setCommandOutput(""); - setMaps([]); - try { - const mapRef1 = document.getElementById("config_map1")! - const mapRef2 = document.getElementById("config_map2")! - - const newMap1 = await GoogleMap.create({ - element: mapRef1, - id: "test-map", - apiKey: apiKey!, - config: { - center: { - lat: 33.6, - lng: -117.9, - }, - zoom: 8 - } - }); - - const newMap2 = await GoogleMap.create({ - element: mapRef2, - id: "test-map2", - apiKey: apiKey!, - config: { - center: { - lat: -33.6, - lng: 117.9, - }, - zoom: 6, - } - }); - - setMaps([newMap1, newMap2]); - setCommandOutput('Maps created'); - } catch(err: any) { - setCommandOutput(err.message); - } - } - - async function moveCameras() { - setCommandOutput(""); - try { - const map1 = maps[0]; - await map1.setCamera({ - coordinate: { - lat: 36.716871, - lng: -119.767456 - }, - angle: 45, - bearing: 200, - zoom: 12, - animate: true, - animationDuration: 50, - }) - - const map2 = maps[1]; - await map2.setCamera({ - coordinate: { - lat: -31.931186, - lng: 115.856323 - }, - angle: 45, - bearing: 200, - zoom: 12, - animate: true, - animationDuration: 50, - }) - } catch(err: any) { - setCommandOutput(err.message); - } - } - - async function setMapType() { - setCommandOutput(""); - try { - const map1 = maps[0]; - await map1.setMapType(MapType.Terrain) - - const map2 = maps[1]; - await map2.setMapType(MapType.Satellite) - } catch(err: any) { - setCommandOutput(err.message); - } - } - - async function enableIndoorMaps() { - setCommandOutput(""); - try { - const map1 = maps[0]; - await map1.setCamera({ - coordinate: { - lat: 44.854682, - lng: -93.241997 - }, - angle: 0, - bearing: 0, - zoom: 17, - animate: true, - animationDuration: 50, - }) - await map1.enableIndoorMaps(true); - } catch(err: any) { - setCommandOutput(err.message); - } - } - - async function enableTrafficLayer() { - setCommandOutput(""); - try { - const map1 = maps[0]; - await map1.enableTrafficLayer(true); - await map1.setCamera({ - zoom: 10, - animate: true, - animationDuration: 50, - }) - - const map2 = maps[0]; - await map2.enableTrafficLayer(true); - } catch(err: any) { - setCommandOutput(err.message); - } - } - - async function disableTrafficLayer() { - setCommandOutput(""); - try { - const map1 = maps[0]; - await map1.enableTrafficLayer(false); - - const map2 = maps[0]; - await map2.enableTrafficLayer(false); - } catch(err: any) { - setCommandOutput(err.message); - } - } - - async function destroyMaps() { - setCommandOutput(""); - try { - if (maps) { - for (let map of maps) { - await map.destroy(); - } - setCommandOutput('Maps destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function showCurrentLocation() { - setCommandOutput(""); - try { - const map1 = maps[0]; - await map1.setCamera({ - zoom: 1, - animate: true, - animationDuration: 50, - }) - await map1.enableCurrentLocation(true); - - const map2 = maps[1]; - await map2.setCamera({ - zoom: 1, - animate: true, - animationDuration: 50, - }); - await map2.enableCurrentLocation(true); - } catch(err: any) { - setCommandOutput(err.message); - } - } - - async function hideCurrentLocation() { - setCommandOutput(""); - try { - const map1 = maps[0]; - await map1.enableCurrentLocation(false); - - const map2 = maps[1]; - await map2.enableCurrentLocation(false); - } catch(err: any) { - setCommandOutput(err.message); - } - } - - async function showAccessibilityElements() { - setCommandOutput(""); - try { - const map1 = maps[0]; - await map1.enableAccessibilityElements(true); - - const map2 = maps[1]; - await map2.enableAccessibilityElements(true); - } catch(err: any) { - setCommandOutput(err.message); - } - } - - async function hideAccessibilityElements() { - setCommandOutput(""); - try { - const map1 = maps[0]; - await map1.enableAccessibilityElements(false); - - const map2 = maps[1]; - await map2.enableAccessibilityElements(false); - } catch(err: any) { - setCommandOutput(err.message); - } - } - - return ( - -
- - Create Maps - - - Destroy Maps - - Move Camera - Set Map Type - Enable Indoor Maps - Enable Traffic Layer - Disable Traffic Layer - Show Current Location - Hide Current Location - Show Acc. Elements - Hide Acc. Elements -
-
- -
- - -
- ) -} - -export default ConfigMapPage; \ No newline at end of file diff --git a/google-maps/e2e-tests/src/pages/Map/CreateAndDestroyMap.tsx b/google-maps/e2e-tests/src/pages/Map/CreateAndDestroyMap.tsx deleted file mode 100644 index c9891be53..000000000 --- a/google-maps/e2e-tests/src/pages/Map/CreateAndDestroyMap.tsx +++ /dev/null @@ -1,238 +0,0 @@ -import { useState } from 'react'; -import { GoogleMap } from '@capacitor/google-maps'; -import { IonButton, IonTextarea } from '@ionic/react'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const CreateAndDestroyMapPage: React.FC = () => { - const [maps, setMaps] = useState([]); - const [commandOutput, setCommandOutput] = useState(''); - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - const onMapReady = (data: any) => { - setCommandOutput(`MAP (${data.mapId}) IS READY`); - }; - - const onMapClick = (data: any) => { - setCommandOutput( - `MAP (${data.mapId}) CLICKED @ (${data.latitude}, ${data.longitude})`, - ); - }; - - const onMapBoundsChanged = (data: any) => { - setCommandOutput( - `MAP (${data.mapId}) BOUNDS CHANGED @ (${JSON.stringify(data.bounds)})`, - ); - } - - async function createMaps() { - setCommandOutput(''); - setMaps([]); - try { - const mapRef1 = document.getElementById('map1')!; - const mapRef2 = document.getElementById('map2')!; - - const newMap1 = await GoogleMap.create( - { - element: mapRef1, - id: 'test-map', - apiKey: apiKey!, - config: { - center: { - lat: 33.6, - lng: -117.9, - }, - zoom: 8, - }, - forceCreate: true, - }, - onMapReady, - ); - - const newMap2 = await GoogleMap.create( - { - element: mapRef2, - id: 'test-map2', - apiKey: apiKey!, - config: { - center: { - lat: -33.6, - lng: 117.9, - }, - zoom: 6, - }, - forceCreate: true, - }, - onMapReady, - ); - - setMaps([newMap1, newMap2]); - setCommandOutput('Maps created'); - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function setOnMapClickListeners() { - setCommandOutput(''); - try { - if (maps) { - for (let map of maps) { - map.setOnMapClickListener(onMapClick); - } - setCommandOutput('Map Click Listeners Set'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - 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 { - if (maps) { - for (let map of maps) { - map.removeAllMapListeners(); - } - - setCommandOutput('Map Click Listeners Destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function disableMapTouchEvents() { - setCommandOutput(''); - - try { - if (maps) { - for (let map of maps) { - map.disableTouch(); - } - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function enableMapTouchEvents() { - setCommandOutput(''); - - try { - if (maps) { - for (let map of maps) { - map.enableTouch(); - } - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function destroyMaps() { - setCommandOutput(''); - try { - if (maps) { - for (let map of maps) { - await map.destroy(); - } - setMaps([]); - setCommandOutput('Maps destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function getBounds() { - setCommandOutput(''); - try { - const bounds = await maps[0].getMapBounds(); - setCommandOutput(JSON.stringify(bounds)); - } catch (err: any) { - setCommandOutput(err.message); - } - } - - return ( - -
- - Create Maps - - - Set On Map Click Listeners - - - Set On Map Bounds Changed Listeners - - - Get Current Bounds - - - Remove On Map Click Listeners - - - Enable Touch Events - - - Disable Touch Events - - - Destroy Maps - -
-
- -
- - -
- ); -}; - -export default CreateAndDestroyMapPage; diff --git a/google-maps/e2e-tests/src/pages/Map/Localization.tsx b/google-maps/e2e-tests/src/pages/Map/Localization.tsx deleted file mode 100644 index ee9da6177..000000000 --- a/google-maps/e2e-tests/src/pages/Map/Localization.tsx +++ /dev/null @@ -1,206 +0,0 @@ -import { useState } from 'react'; -import { GoogleMap } from '@capacitor/google-maps'; -import { IonButton, IonTextarea } from '@ionic/react'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const LocalizationPage: React.FC = () => { - const [maps, setMaps] = useState([]); - const [commandOutput, setCommandOutput] = useState(''); - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - const onMapReady = (data: any) => { - setCommandOutput(`MAP (${data.mapId}) IS READY`); - }; - - const onMapClick = (data: any) => { - setCommandOutput( - `MAP (${data.mapId}) CLICKED @ (${data.latitude}, ${data.longitude})`, - ); - }; - - const onMapBoundsChanged = (data: any) => { - setCommandOutput( - `MAP (${data.mapId}) BOUNDS CHANGED @ (${JSON.stringify(data.bounds)})`, - ); - }; - - async function createMaps() { - setCommandOutput(''); - setMaps([]); - try { - const mapRef1 = document.getElementById('map1')!; - const mapRef2 = document.getElementById('map2')!; - - const newMap1 = await GoogleMap.create( - { - element: mapRef1, - id: 'test-map', - apiKey: apiKey!, - config: { - center: { - lat: 33.6, - lng: -117.9, - }, - zoom: 8, - }, - forceCreate: true, - region: 'JP', - language: 'ja', - }, - onMapReady, - ); - - const newMap2 = await GoogleMap.create( - { - element: mapRef2, - id: 'test-map2', - apiKey: apiKey!, - config: { - center: { - lat: -33.6, - lng: 117.9, - }, - zoom: 6, - }, - forceCreate: true, - }, - onMapReady, - ); - - setMaps([newMap1, newMap2]); - setCommandOutput('Maps created'); - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function setOnMapClickListeners() { - setCommandOutput(''); - try { - if (maps) { - for (let map of maps) { - map.setOnMapClickListener(onMapClick); - } - setCommandOutput('Map Click Listeners Set'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - 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 { - if (maps) { - for (let map of maps) { - map.removeAllMapListeners(); - } - - setCommandOutput('Map Click Listeners Destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function destroyMaps() { - setCommandOutput(''); - try { - if (maps) { - for (let map of maps) { - await map.destroy(); - } - setMaps([]); - setCommandOutput('Maps destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function getBounds() { - setCommandOutput(''); - try { - const bounds = await maps[0].getMapBounds(); - setCommandOutput(JSON.stringify(bounds)); - } catch (err: any) { - setCommandOutput(err.message); - } - } - - return ( - -
- - Create Maps - - - Set On Map Click Listeners - - - Set On Map Bounds Changed Listeners - - - Get Current Bounds - - - Remove On Map Click Listeners - - - Destroy Maps - -
-
- -
- - -
- ); -}; - -export default LocalizationPage; diff --git a/google-maps/e2e-tests/src/pages/Map/ResizeMap.tsx b/google-maps/e2e-tests/src/pages/Map/ResizeMap.tsx deleted file mode 100644 index 0cc1b734a..000000000 --- a/google-maps/e2e-tests/src/pages/Map/ResizeMap.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import { useState } from 'react'; -import { GoogleMap } from '@capacitor/google-maps'; -import { - IonButton, - IonTextarea, -} from '@ionic/react'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const ResizeMapPage: React.FC = () => { - const [map, setMap] = useState(); - const [commandOutput, setCommandOutput] = useState(''); - const [mapWidth, setMapWidth] = useState(window.outerWidth); - const [mapHeight, setMapHeight] = useState(window.outerWidth); - - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - async function createMap() { - setCommandOutput(''); - setMap(null); - try { - const mapRef = document.getElementById('map')!; - - const newMap = await GoogleMap.create({ - element: mapRef, - id: 'test-map', - apiKey: apiKey!, - config: { - center: { - lat: 33.6, - lng: -117.9, - }, - zoom: 8, - }, - forceCreate: true, - }); - - setMap(newMap); - setCommandOutput('Map created'); - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function destroyMap() { - setCommandOutput(''); - try { - if (map) { - await map.destroy(); - setMap(null); - setCommandOutput('Map destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function enlargeMap() { - setMapWidth(window.outerWidth); - setMapHeight(window.outerWidth); - } - - async function shrinkMap() { - setMapWidth(mapWidth / 2); - setMapHeight(mapHeight / 2); - } - - return ( - -
- - Create Map - - - Destroy Map - - Enlarge Map - Shrink Map -
-
- -
- -
- ); -}; - -export default ResizeMapPage; diff --git a/google-maps/e2e-tests/src/pages/Markers/AddAndRemoveMarkers.tsx b/google-maps/e2e-tests/src/pages/Markers/AddAndRemoveMarkers.tsx deleted file mode 100644 index ffa8ac0cf..000000000 --- a/google-maps/e2e-tests/src/pages/Markers/AddAndRemoveMarkers.tsx +++ /dev/null @@ -1,164 +0,0 @@ -import { useState } from 'react'; -import { GoogleMap } from '@capacitor/google-maps'; -import { IonButton, IonTextarea } from '@ionic/react'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const AddAndRemoveMarkers: React.FC = () => { - const [map, setMap] = useState(null); - const [markerId, setMarkerId] = useState(""); - const [commandOutput, setCommandOutput] = useState(''); - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - const onMarkerClick = (data: any) => { - setCommandOutput(`MARKER (${data.markerId}) WAS CLICKED ON MAP (${data.mapId})`); - } - - const onMarkerDragStart = (data: any) => { - setCommandOutput(`MARKER (${data.markerId}) DRAG STARTED ON MAP (${data.mapId})`); - } - - const onMarkerDrag = (data: any) => { - setCommandOutput(`MARKER (${data.markerId}) IS BEING DRAGGED ON MAP (${data.mapId})`); - } - - const onMarkerDragEnd = (data: any) => { - setCommandOutput(`MARKER (${data.markerId}) DRAG ENDED ON MAP (${data.mapId})`); - } - - - const onInfoWindowClick = (data: any) => { - setCommandOutput(`INFO WINDOW (${data.markerId}) WAS CLICKED ON MAP (${data.mapId})`); - } - - async function createMap() { - try { - const mapRef1 = document.getElementById("markers_map1")! - const newMap = await GoogleMap.create({ - element: mapRef1, - id: "test-map", - apiKey: apiKey!, - config: { - center: { - lat: 33.6, - lng: -117.9, - }, - zoom: 8, - }, - }); - setMap(newMap); - - setCommandOutput("Map created"); - - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function setOnMarkerClickListener() { - map?.setOnMarkerClickListener(onMarkerClick); - map?.setOnMarkerDragStartListener(onMarkerDragStart); - map?.setOnMarkerDragListener(onMarkerDrag); - map?.setOnMarkerDragEndListener(onMarkerDragEnd); - map?.setOnInfoWindowClickListener(onInfoWindowClick); - setCommandOutput('Set On Marker Click / Drag Listeners!'); - } - - async function removeOnMarkerClickListener() { - map?.setOnMarkerClickListener(); - map?.setOnMarkerDragStartListener(); - map?.setOnMarkerDragListener(); - map?.setOnMarkerDragEndListener(); - map?.setOnInfoWindowClickListener(); - setCommandOutput('Removed On Marker Click / Drag Listeners!'); - } - - async function addMarker() { - try { - if (!map) { - throw new Error("map not created"); - } - - const id = await map.addMarker({ - coordinate: { - lat: 33.6, - lng: -117.9, - }, - title: "Hello world", - snippet: "Hola Mundo", - draggable: true, - }); - - setMarkerId(id); - setCommandOutput(`Marker added: ${id}`) - - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function removeMarker() { - try { - if (markerId === "") { - throw new Error("marker id not set"); - } - - if (!map) { - throw new Error("map not created"); - } - - await map.removeMarker(markerId); - setCommandOutput(`Marker removed: ${markerId}`) - } catch (err: any) { - setCommandOutput(err.message); - } - } - - async function destroyMap() { - setCommandOutput(""); - try { - if (map) { - await map.destroy(); - setCommandOutput('Map destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - return ( - -
- - Create Map - - - Set On Marker Click / Drag Listeners - - - Remove On Marker Click / Drag Listeners - - - Add 1 Marker - - - Remove Marker - - - Destroy Map - -
-
- -
- -
- ) -} - -export default AddAndRemoveMarkers; \ No newline at end of file diff --git a/google-maps/e2e-tests/src/pages/Markers/MarkerCustomizations.tsx b/google-maps/e2e-tests/src/pages/Markers/MarkerCustomizations.tsx deleted file mode 100644 index ac86bd778..000000000 --- a/google-maps/e2e-tests/src/pages/Markers/MarkerCustomizations.tsx +++ /dev/null @@ -1,389 +0,0 @@ -import { useState } from 'react'; -import { GoogleMap, Marker } from '@capacitor/google-maps'; -import { IonButton, IonTextarea } from '@ionic/react'; - -import BaseTestingPage from '../../components/BaseTestingPage'; - -const MarkerCustomizations: React.FC = () => { - const [map, setMap] = useState(null); - const [markerIds, setMarkerIds] = useState([]); - const [commandOutput, setCommandOutput] = useState(''); - - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - const getRandom = (): number => { - return Math.floor(Math.random() * 256); - }; - - async function createMap() { - try { - const element = document.getElementById('map_marker_custom'); - if (element !== null) { - const newMap = await GoogleMap.create({ - element: element, - id: 'test-map', - apiKey: apiKey!, - config: { - center: { - lat: 43.547302, - lng: -96.728333, - }, - zoom: 9, - }, - }); - - setMap(newMap); - - setCommandOutput('Map created'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - const addMarkerColor = async () => { - try { - if (!map) { - throw new Error('map not created'); - } - - const id = await map.addMarker({ - coordinate: { - lat: 43.581386, - lng: -96.739025, - }, - tintColor: { - r: 41, - g: 71, - b: 157, - a: 1, - }, - }); - - map.setCamera({ - coordinate: { - lat: 43.547302, - lng: -96.728333, - }, - zoom: 9, - }); - setMarkerIds(markerIds.concat([id])); - setCommandOutput('1 color marker added'); - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const addMarkerImage = async () => { - try { - if (!map) { - throw new Error('map not created'); - } - - const id = await map.addMarker({ - coordinate: { - lat: 43.512098, - lng: -96.739352, - }, - iconUrl: 'assets/icon/pin.png', - iconSize: { - width: 30, - height: 30, - }, - iconOrigin: { x: 0, y: 0 }, - iconAnchor: { x: 15, y: 30 }, - }); - - map.setCamera({ - coordinate: { - lat: 43.547302, - lng: -96.728333, - }, - zoom: 9, - }); - - setMarkerIds(markerIds.concat([id])); - setCommandOutput('1 image marker added'); - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const addMarkerSVG = async () => { - try { - if (!map) { - throw new Error('map not created'); - } - - const id = await map.addMarker({ - coordinate: { - lat: 43.512098, - lng: -96.739352, - }, - iconUrl: 'assets/icon/marker.svg', - iconSize: { - width: 30, - height: 30, - }, - iconOrigin: { x: 0, y: 0 }, - iconAnchor: { x: 15, y: 30 }, - }); - - map.setCamera({ - coordinate: { - lat: 43.547302, - lng: -96.728333, - }, - zoom: 9, - }); - - setMarkerIds(markerIds.concat([id])); - setCommandOutput('1 image marker added'); - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const addMultipleImageMarkers = async () => { - try { - if (!map) { - throw new Error('map not created'); - } - const markers: Marker[] = [ - { - coordinate: { - lat: 47.6, - lng: -122.33, - }, - title: 'Title 1', - snippet: 'Snippet 1', - iconUrl: 'assets/icon/pin.png', - iconSize: { - width: 30, - height: 30, - }, - }, - { - coordinate: { - lat: 47.6, - lng: -122.46, - }, - title: 'Title 2', - snippet: 'Snippet 2', - iconUrl: 'assets/icon/pin.png', - iconSize: { - width: 30, - height: 30, - }, - }, - { - coordinate: { - lat: 47.3, - lng: -122.46, - }, - title: 'Title 3', - snippet: 'Snippet 3', - iconUrl: 'assets/icon/pin.png', - iconSize: { - width: 30, - height: 30, - }, - }, - { - coordinate: { - lat: 47.2, - lng: -122.23, - }, - title: 'Title 4', - snippet: 'Snippet 4', - iconUrl: 'assets/icon/pin.png', - iconSize: { - width: 30, - height: 30, - }, - }, - ]; - - const ids = await map.addMarkers(markers); - map.setCamera({ - animate: true, - coordinate: { - lat: 47.6, - lng: -122.33, - }, - zoom: 7, - }); - setMarkerIds(markerIds.concat(ids)); - setCommandOutput(`${ids.length} image markers added`); - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const addMultipleColorMarkers = async () => { - try { - if (!map) { - throw new Error('map not created'); - } - const markers: Marker[] = [ - { - coordinate: { - lat: 47.6, - lng: -122.33, - }, - title: 'Title 1', - snippet: 'Snippet 1', - tintColor: { - r: getRandom(), - g: getRandom(), - b: getRandom(), - a: 1, - }, - }, - { - coordinate: { - lat: 47.6, - lng: -122.46, - }, - title: 'Title 2', - snippet: 'Snippet 2', - tintColor: { - r: getRandom(), - g: getRandom(), - b: getRandom(), - a: 1, - }, - }, - { - coordinate: { - lat: 47.3, - lng: -122.46, - }, - title: 'Title 3', - snippet: 'Snippet 3', - tintColor: { - r: getRandom(), - g: getRandom(), - b: getRandom(), - a: 1, - }, - }, - { - coordinate: { - lat: 47.2, - lng: -122.23, - }, - title: 'Title 4', - snippet: 'Snippet 4', - tintColor: { - r: getRandom(), - g: getRandom(), - b: getRandom(), - a: 1, - }, - }, - ]; - - const ids = await map.addMarkers(markers); - map.setCamera({ - animate: true, - coordinate: { - lat: 47.6, - lng: -122.33, - }, - zoom: 7, - }); - setMarkerIds(markerIds.concat(ids)); - setCommandOutput(`${ids.length} color markers added`); - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - const removeAllMarkers = async () => { - try { - if (!map) { - throw new Error('map not created'); - } - - let count = markerIds.length; - - await map.removeMarkers(markerIds); - setMarkerIds([]); - - setCommandOutput(`${count} markers removed`); - } catch (err: any) { - setCommandOutput(err.message); - } - }; - - async function destroyMap() { - setCommandOutput(''); - try { - if (map) { - await map.destroy(); - setCommandOutput('Map destroyed'); - } - } catch (err: any) { - setCommandOutput(err.message); - } - } - - return ( - -
- - Create Map - - - Add Marker with Image - - - Add Marker with SVG - - - Add Marker with Color - - - Add Multiple Image Markers - - - Add Multiple Color Markers - - - Remove All Markers - - - Destroy Map - -
-
- -
- -
- ); -}; - -export default MarkerCustomizations; diff --git a/google-maps/e2e-tests/src/pages/Markers/MultipleMarkers.tsx b/google-maps/e2e-tests/src/pages/Markers/MultipleMarkers.tsx deleted file mode 100644 index 0108d8aab..000000000 --- a/google-maps/e2e-tests/src/pages/Markers/MultipleMarkers.tsx +++ /dev/null @@ -1,276 +0,0 @@ -import { useState } from 'react'; -import { GoogleMap, Marker } from '@capacitor/google-maps'; -import { IonButton, IonTextarea } from '@ionic/react'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const MultipleMarkers: React.FC = () => { - const [map, setMap] = useState(null); - const [markerIds, setMarkerIds] = useState([]); - const [commandOutput, setCommandOutput] = useState(''); - const [commandOutput2, setCommandOutput2] = useState(''); - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - const onBoundsChanged = (data: any) => { - setCommandOutput(`BOUNDS CHANGED: ${JSON.stringify(data)}`); - }; - - const onCameraIdle = (data: any) => { - setCommandOutput(`CAMERA IDLE: ${JSON.stringify(data)}`); - }; - - const onCameraMoveStarted = (data: any) => { - setCommandOutput(`CAMERA MOVE STARTED: ${JSON.stringify(data)}`); - }; - - const onClusterClick = (data: any) => { - setCommandOutput2(`CLUSTER CLICKED: ${JSON.stringify(data)}`); - }; - - const onClusterInfoWindowClick = (data: any) => { - setCommandOutput2(`CLUSTER INFO WINDOW CLICKED: ${JSON.stringify(data)}`); - }; - - const onInfoWindowClick = (data: any) => { - setCommandOutput2(`INFO WINDOW CLICKED: ${JSON.stringify(data)}`); - }; - - const onMapClick = (data: any) => { - setCommandOutput(`MAP CLICKED: ${JSON.stringify(data)}`); - setCommandOutput2(''); - }; - - const onMarkerClick = (data: any) => { - setCommandOutput2(`MARKER CLICKED: ${JSON.stringify(data)}`); - }; - - const onMyLocationButtonClick = (data: any) => { - setCommandOutput2(`MY LOCATION BUTTON CLICKED: ${JSON.stringify(data)}`); - }; - - const onMyLocationClick = (data: any) => { - setCommandOutput2(`MY LOCATION CLICKED: ${JSON.stringify(data)}`); - }; - - async function createMap() { - try { - const element = document.getElementById('multipleMarkers_map1'); - if (element !== null) { - const newMap = await GoogleMap.create({ - element: element, - id: 'test-map', - apiKey: apiKey!, - config: { - center: { - lat: 47.6, - lng: -122.33, - }, - zoom: 5, - }, - }); - - setMap(newMap); - - setCommandOutput('Map created'); - setCommandOutput2(''); - } - } catch (err: any) { - setCommandOutput(err.message); - setCommandOutput2(''); - } - } - - async function setEventListeners() { - map?.setOnBoundsChangedListener(onBoundsChanged); - map?.setOnCameraIdleListener(onCameraIdle); - map?.setOnCameraMoveStartedListener(onCameraMoveStarted); - map?.setOnClusterClickListener(onClusterClick); - map?.setOnClusterInfoWindowClickListener(onClusterInfoWindowClick); - map?.setOnInfoWindowClickListener(onInfoWindowClick); - map?.setOnMapClickListener(onMapClick); - map?.setOnMarkerClickListener(onMarkerClick); - map?.setOnMyLocationButtonClickListener(onMyLocationButtonClick); - map?.setOnMyLocationClickListener(onMyLocationClick); - setCommandOutput('Set Event Listeners!'); - setCommandOutput2(''); - } - - async function removeEventListeners() { - map?.removeAllMapListeners(); - setCommandOutput('Removed Event Listeners!'); - setCommandOutput2(''); - } - - async function enableClustering() { - try { - if (map) { - await map.enableClustering(2); - setCommandOutput('marker clustering enabled'); - setCommandOutput2(''); - } - } catch (err: any) { - setCommandOutput(err.message); - setCommandOutput2(''); - } - } - - async function addMultipleMarkers() { - try { - if (map) { - const markers: Marker[] = [ - { - coordinate: { - lat: 47.6, - lng: -122.33, - }, - title: 'Title 1', - snippet: 'Snippet 1', - }, - { - coordinate: { - lat: 47.6, - lng: -122.46, - }, - title: 'Title 2', - snippet: 'Snippet 2', - }, - { - coordinate: { - lat: 47.3, - lng: -122.46, - }, - title: 'Title 3', - snippet: 'Snippet 3', - }, - { - coordinate: { - lat: 47.2, - lng: -122.23, - }, - title: 'Title 4', - snippet: 'Snippet 4', - }, - ]; - - const ids = await map.addMarkers(markers); - console.log('@@IDS: ', ids); - setMarkerIds(ids); - setCommandOutput(`${ids.length} markers added`); - setCommandOutput2(''); - } - } catch (err: any) { - setCommandOutput(err.message); - setCommandOutput2(''); - } - } - - async function removeAllMarkers() { - try { - if (map) { - await map.removeMarkers(markerIds); - setCommandOutput(`${markerIds.length} markers removed`); - setCommandOutput2(''); - setMarkerIds([]); - } - } catch (err: any) { - setCommandOutput(err.message); - setCommandOutput2(''); - } - } - - async function disableClustering() { - try { - if (map) { - await map.disableClustering(); - setCommandOutput('marker clustering disabled'); - setCommandOutput2(''); - } - } catch (err: any) { - setCommandOutput(err.message); - setCommandOutput2(''); - } - } - - async function destroyMap() { - setCommandOutput(''); - try { - if (map) { - await map.destroy(); - setCommandOutput('Map destroyed'); - setCommandOutput2(''); - } - } catch (err: any) { - setCommandOutput(err.message); - setCommandOutput2(''); - } - } - - async function showCurrentLocation() { - await map?.setCamera({ - zoom: 1, - animate: true, - animationDuration: 50, - }); - await map?.enableCurrentLocation(true); - } - - async function showCurrentBounds() { - const bounds = await map?.getMapBounds(); - setCommandOutput(JSON.stringify(bounds)); - } - - return ( - -
- - Create Map - - - Set Event Listeners - - - Remove Event Listeners - - - Show Current Location - - - Show Current Bounds - - - Add Multiple Markers - - - Enable Clustering - - - Disable Clustering - - - Remove Markers - - - Destroy Map - -
-
- - -
- -
- ); -}; - -export default MultipleMarkers; diff --git a/google-maps/e2e-tests/src/pages/Scrolling/SimpleScrolling.tsx b/google-maps/e2e-tests/src/pages/Scrolling/SimpleScrolling.tsx deleted file mode 100644 index 0020cb19a..000000000 --- a/google-maps/e2e-tests/src/pages/Scrolling/SimpleScrolling.tsx +++ /dev/null @@ -1,191 +0,0 @@ -import { useState } from 'react'; -import { GoogleMap } from '@capacitor/google-maps'; -import { IonButton, IonContent, IonTextarea } from '@ionic/react'; -import BaseTestingPage from '../../components/BaseTestingPage'; - -const SimpleScrollingPage: React.FC = () => { - const [map, setMap] = useState(null); - const [commandOutput, setCommandOutput] = useState(''); - const apiKey = process.env.REACT_APP_GOOGLE_MAPS_API_KEY; - - async function createMaps() { - const mapRef = document.getElementById('map')!; - setCommandOutput(''); - setMap(null); - try { - const newMap1 = await GoogleMap.create({ - element: mapRef, - id: 'test-map', - apiKey: apiKey!, - config: { - center: { - lat: 33.6, - lng: -117.9, - }, - zoom: 8, - } - }); - - setMap(newMap1); - setCommandOutput('Maps created'); - console.log('Maps created'); - } catch (err: any) { - console.log(err.message); - } - } - - async function destroyMaps() { - setCommandOutput(''); - try { - if (map) { - await map.destroy(); - console.log('map destroyed'); - } - } catch (err: any) { - console.log(err.message); - } - } - - return ( - -
- - Create Maps - - - Destroy Maps - -
- -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

- - - -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla - vulputate eget ipsum vel venenatis. Ut dui enim, elementum vel - convallis a, malesuada a nibh. Etiam sit amet purus orci. Sed sit amet - sapien non libero mollis tempus eget non lacus. Proin vel nisi sit - amet neque luctus hendrerit ac at nisi. Maecenas malesuada neque dui, - a ornare neque efficitur id. Duis a quam ut lacus euismod ultrices sed - non libero. -

-
-
-
- ); -}; - -export default SimpleScrollingPage; diff --git a/google-maps/e2e-tests/src/react-app-env.d.ts b/google-maps/e2e-tests/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5fc..000000000 --- a/google-maps/e2e-tests/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/google-maps/e2e-tests/src/reportWebVitals.ts b/google-maps/e2e-tests/src/reportWebVitals.ts deleted file mode 100644 index 49a2a16e0..000000000 --- a/google-maps/e2e-tests/src/reportWebVitals.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ReportHandler } from 'web-vitals'; - -const reportWebVitals = (onPerfEntry?: ReportHandler) => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/google-maps/e2e-tests/src/routes.ts b/google-maps/e2e-tests/src/routes.ts deleted file mode 100644 index 5f8180fcb..000000000 --- a/google-maps/e2e-tests/src/routes.ts +++ /dev/null @@ -1,142 +0,0 @@ -import { triangleOutline, triangleSharp } from 'ionicons/icons'; -import React from 'react'; -import PolylineMapPage from './pages/Drawing/Polylines'; -import BoundsMapPage from './pages/Map/Bounds'; -import ConfigMapPage from './pages/Map/ConfigMap'; -import CreateAndDestroyMapPage from './pages/Map/CreateAndDestroyMap'; -import LocalizationPage from './pages/Map/Localization'; -import AddAndRemoveMarkers from './pages/Markers/AddAndRemoveMarkers'; -import MarkerCustomizations from './pages/Markers/MarkerCustomizations'; -import MultipleMarkers from './pages/Markers/MultipleMarkers'; -import SimpleScrollingPage from './pages/Scrolling/SimpleScrolling'; -import PolygonMapPage from './pages/Drawing/Polygons'; -import CircleMapPage from './pages/Drawing/Circles'; -import ResizeMapPage from './pages/Map/ResizeMap'; - -export type RouteDescription = { - title: string; - url: string; - iosIcon: string; - mdIcon: string; - component: React.FC; -}; - -export type RouteGroup = { - groupName: string; - pages: RouteDescription[]; -}; - -const routesList: RouteGroup[] = [ - { - groupName: 'Maps', - pages: [ - { - title: 'Create and Destroy Maps', - url: '/maps/create-and-destroy', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: CreateAndDestroyMapPage, - }, - { - title: 'Map Localization', - url: '/maps/localization', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: LocalizationPage, - }, - { - title: 'Config Maps', - url: '/maps/config', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: ConfigMapPage, - }, - { - title: 'Bounds', - url: '/maps/bounds', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: BoundsMapPage, - }, - { - title: 'Simple Scrolling', - url: '/maps/scrolling', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: SimpleScrollingPage, - }, - { - title: 'Resize Map', - url: '/maps/resize', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: ResizeMapPage, - }, - ], - }, - { - groupName: 'Markers', - pages: [ - { - title: 'Add and Remove Marker', - url: '/markers/add-and-remove', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: AddAndRemoveMarkers, - }, - { - title: 'Multiple Markers', - url: '/markers/multiple-markers', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: MultipleMarkers, - }, - { - title: 'Marker Customization', - url: '/markers/customization', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: MarkerCustomizations, - }, - ], - }, - { - groupName: 'Drawing', - pages: [ - { - title: 'Polygons', - url: '/drawing/polygons', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: PolygonMapPage, - }, - { - title: 'Circles', - url: '/drawing/circles', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: CircleMapPage, - }, - { - title: 'Polylines', - url: '/drawing/polylines', - iosIcon: triangleOutline, - mdIcon: triangleSharp, - component: PolylineMapPage, - }, - ], - }, -]; - -export function getRouterSetup(): RouteDescription[] { - let allPages: RouteDescription[] = []; - for (const routeGroup of routesList) { - allPages = [...allPages, ...routeGroup.pages]; - } - - return allPages; -} - -export function getMenuList(): RouteGroup[] { - return routesList; -} diff --git a/google-maps/e2e-tests/src/service-worker.ts b/google-maps/e2e-tests/src/service-worker.ts deleted file mode 100644 index 652a8a4af..000000000 --- a/google-maps/e2e-tests/src/service-worker.ts +++ /dev/null @@ -1,80 +0,0 @@ -/// -/* eslint-disable no-restricted-globals */ - -// This service worker can be customized! -// See https://developers.google.com/web/tools/workbox/modules -// for the list of available Workbox modules, or add any other -// code you'd like. -// You can also remove this file if you'd prefer not to use a -// service worker, and the Workbox build step will be skipped. - -import { clientsClaim } from 'workbox-core'; -import { ExpirationPlugin } from 'workbox-expiration'; -import { precacheAndRoute, createHandlerBoundToURL } from 'workbox-precaching'; -import { registerRoute } from 'workbox-routing'; -import { StaleWhileRevalidate } from 'workbox-strategies'; - -declare const self: ServiceWorkerGlobalScope; - -clientsClaim(); - -// Precache all of the assets generated by your build process. -// Their URLs are injected into the manifest variable below. -// This variable must be present somewhere in your service worker file, -// even if you decide not to use precaching. See https://cra.link/PWA -precacheAndRoute(self.__WB_MANIFEST); - -// Set up App Shell-style routing, so that all navigation requests -// are fulfilled with your index.html shell. Learn more at -// https://developers.google.com/web/fundamentals/architecture/app-shell -const fileExtensionRegexp = new RegExp('/[^/?]+\\.[^/]+$'); -registerRoute( - // Return false to exempt requests from being fulfilled by index.html. - ({ request, url }: { request: Request; url: URL }) => { - // If this isn't a navigation, skip. - if (request.mode !== 'navigate') { - return false; - } - - // If this is a URL that starts with /_, skip. - if (url.pathname.startsWith('/_')) { - return false; - } - - // If this looks like a URL for a resource, because it contains - // a file extension, skip. - if (url.pathname.match(fileExtensionRegexp)) { - return false; - } - - // Return true to signal that we want to use the handler. - return true; - }, - createHandlerBoundToURL(process.env.PUBLIC_URL + '/index.html') -); - -// An example runtime caching route for requests that aren't handled by the -// precache, in this case same-origin .png requests like those from in public/ -registerRoute( - // Add in any other file extensions or routing criteria as needed. - ({ url }) => url.origin === self.location.origin && url.pathname.endsWith('.png'), - // Customize this strategy as needed, e.g., by changing to CacheFirst. - new StaleWhileRevalidate({ - cacheName: 'images', - plugins: [ - // Ensure that once this runtime cache reaches a maximum size the - // least-recently used images are removed. - new ExpirationPlugin({ maxEntries: 50 }), - ], - }) -); - -// This allows the web app to trigger skipWaiting via -// registration.waiting.postMessage({type: 'SKIP_WAITING'}) -self.addEventListener('message', (event) => { - if (event.data && event.data.type === 'SKIP_WAITING') { - self.skipWaiting(); - } -}); - -// Any other custom service worker logic can go here. diff --git a/google-maps/e2e-tests/src/serviceWorkerRegistration.ts b/google-maps/e2e-tests/src/serviceWorkerRegistration.ts deleted file mode 100644 index efbf2ac42..000000000 --- a/google-maps/e2e-tests/src/serviceWorkerRegistration.ts +++ /dev/null @@ -1,142 +0,0 @@ -// This optional code is used to register a service worker. -// register() is not called by default. - -// This lets the app load faster on subsequent visits in production, and gives -// it offline capabilities. However, it also means that developers (and users) -// will only see deployed updates on subsequent visits to a page, after all the -// existing tabs open on the page have been closed, since previously cached -// resources are updated in the background. - -// To learn more about the benefits of this model and instructions on how to -// opt-in, read https://cra.link/PWA - -const isLocalhost = Boolean( - window.location.hostname === 'localhost' || - // [::1] is the IPv6 localhost address. - window.location.hostname === '[::1]' || - // 127.0.0.0/8 are considered localhost for IPv4. - window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/) -); - -type Config = { - onSuccess?: (registration: ServiceWorkerRegistration) => void; - onUpdate?: (registration: ServiceWorkerRegistration) => void; -}; - -export function register(config?: Config) { - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { - // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); - if (publicUrl.origin !== window.location.origin) { - // Our service worker won't work if PUBLIC_URL is on a different origin - // from what our page is served on. This might happen if a CDN is used to - // serve assets; see https://github.com/facebook/create-react-app/issues/2374 - return; - } - - window.addEventListener('load', () => { - const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; - - if (isLocalhost) { - // This is running on localhost. Let's check if a service worker still exists or not. - checkValidServiceWorker(swUrl, config); - - // Add some additional logging to localhost, pointing developers to the - // service worker/PWA documentation. - navigator.serviceWorker.ready.then(() => { - console.log( - 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://cra.link/PWA' - ); - }); - } else { - // Is not localhost. Just register service worker - registerValidSW(swUrl, config); - } - }); - } -} - -function registerValidSW(swUrl: string, config?: Config) { - navigator.serviceWorker - .register(swUrl) - .then((registration) => { - registration.onupdatefound = () => { - const installingWorker = registration.installing; - if (installingWorker == null) { - return; - } - installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { - if (navigator.serviceWorker.controller) { - // At this point, the updated precached content has been fetched, - // but the previous service worker will still serve the older - // content until all client tabs are closed. - console.log( - 'New content is available and will be used when all ' + - 'tabs for this page are closed. See https://cra.link/PWA.' - ); - - // Execute callback - if (config && config.onUpdate) { - config.onUpdate(registration); - } - } else { - // At this point, everything has been precached. - // It's the perfect time to display a - // "Content is cached for offline use." message. - console.log('Content is cached for offline use.'); - - // Execute callback - if (config && config.onSuccess) { - config.onSuccess(registration); - } - } - } - }; - }; - }) - .catch((error) => { - console.error('Error during service worker registration:', error); - }); -} - -function checkValidServiceWorker(swUrl: string, config?: Config) { - // Check if the service worker can be found. If it can't reload the page. - fetch(swUrl, { - headers: { 'Service-Worker': 'script' }, - }) - .then((response) => { - // Ensure service worker exists, and that we really are getting a JS file. - const contentType = response.headers.get('content-type'); - if ( - response.status === 404 || - (contentType != null && contentType.indexOf('javascript') === -1) - ) { - // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then((registration) => { - registration.unregister().then(() => { - window.location.reload(); - }); - }); - } else { - // Service worker found. Proceed as normal. - registerValidSW(swUrl, config); - } - }) - .catch(() => { - console.log('No internet connection found. App is running in offline mode.'); - }); -} - -export function unregister() { - if ('serviceWorker' in navigator) { - navigator.serviceWorker.ready - .then((registration) => { - registration.unregister(); - }) - .catch((error) => { - console.error(error.message); - }); - } -} diff --git a/google-maps/e2e-tests/src/setupTests.ts b/google-maps/e2e-tests/src/setupTests.ts deleted file mode 100644 index 87988d6bd..000000000 --- a/google-maps/e2e-tests/src/setupTests.ts +++ /dev/null @@ -1,14 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom/extend-expect'; - -// Mock matchmedia -window.matchMedia = window.matchMedia || function() { - return { - matches: false, - addListener: function() {}, - removeListener: function() {} - }; -}; diff --git a/google-maps/e2e-tests/src/theme/variables.css b/google-maps/e2e-tests/src/theme/variables.css deleted file mode 100644 index 9b1948ec9..000000000 --- a/google-maps/e2e-tests/src/theme/variables.css +++ /dev/null @@ -1,244 +0,0 @@ -/* Ionic Variables and Theming. For more info, please see: -http://ionicframework.com/docs/theming/ */ - -ion-content { - --background: transparent; -} - -body { - background: transparent; -} - -/** Ionic CSS Variables **/ -:root { - /** primary **/ - --ion-color-primary: #3880ff; - --ion-color-primary-rgb: 56, 128, 255; - --ion-color-primary-contrast: #ffffff; - --ion-color-primary-contrast-rgb: 255, 255, 255; - --ion-color-primary-shade: #3171e0; - --ion-color-primary-tint: #4c8dff; - - /** secondary **/ - --ion-color-secondary: #3dc2ff; - --ion-color-secondary-rgb: 61, 194, 255; - --ion-color-secondary-contrast: #ffffff; - --ion-color-secondary-contrast-rgb: 255, 255, 255; - --ion-color-secondary-shade: #36abe0; - --ion-color-secondary-tint: #50c8ff; - - /** tertiary **/ - --ion-color-tertiary: #5260ff; - --ion-color-tertiary-rgb: 82, 96, 255; - --ion-color-tertiary-contrast: #ffffff; - --ion-color-tertiary-contrast-rgb: 255, 255, 255; - --ion-color-tertiary-shade: #4854e0; - --ion-color-tertiary-tint: #6370ff; - - /** success **/ - --ion-color-success: #2dd36f; - --ion-color-success-rgb: 45, 211, 111; - --ion-color-success-contrast: #ffffff; - --ion-color-success-contrast-rgb: 255, 255, 255; - --ion-color-success-shade: #28ba62; - --ion-color-success-tint: #42d77d; - - /** warning **/ - --ion-color-warning: #ffc409; - --ion-color-warning-rgb: 255, 196, 9; - --ion-color-warning-contrast: #000000; - --ion-color-warning-contrast-rgb: 0, 0, 0; - --ion-color-warning-shade: #e0ac08; - --ion-color-warning-tint: #ffca22; - - /** danger **/ - --ion-color-danger: #eb445a; - --ion-color-danger-rgb: 235, 68, 90; - --ion-color-danger-contrast: #ffffff; - --ion-color-danger-contrast-rgb: 255, 255, 255; - --ion-color-danger-shade: #cf3c4f; - --ion-color-danger-tint: #ed576b; - - /** dark **/ - --ion-color-dark: #222428; - --ion-color-dark-rgb: 34, 36, 40; - --ion-color-dark-contrast: #ffffff; - --ion-color-dark-contrast-rgb: 255, 255, 255; - --ion-color-dark-shade: #1e2023; - --ion-color-dark-tint: #383a3e; - - /** medium **/ - --ion-color-medium: #92949c; - --ion-color-medium-rgb: 146, 148, 156; - --ion-color-medium-contrast: #ffffff; - --ion-color-medium-contrast-rgb: 255, 255, 255; - --ion-color-medium-shade: #808289; - --ion-color-medium-tint: #9d9fa6; - - /** light **/ - --ion-color-light: #f4f5f8; - --ion-color-light-rgb: 244, 245, 248; - --ion-color-light-contrast: #000000; - --ion-color-light-contrast-rgb: 0, 0, 0; - --ion-color-light-shade: #d7d8da; - --ion-color-light-tint: #f5f6f9; -} - -@media (prefers-color-scheme: dark) { - /* - * Dark Colors - * ------------------------------------------- - */ - - body { - --ion-color-primary: #428cff; - --ion-color-primary-rgb: 66,140,255; - --ion-color-primary-contrast: #ffffff; - --ion-color-primary-contrast-rgb: 255,255,255; - --ion-color-primary-shade: #3a7be0; - --ion-color-primary-tint: #5598ff; - - --ion-color-secondary: #50c8ff; - --ion-color-secondary-rgb: 80,200,255; - --ion-color-secondary-contrast: #ffffff; - --ion-color-secondary-contrast-rgb: 255,255,255; - --ion-color-secondary-shade: #46b0e0; - --ion-color-secondary-tint: #62ceff; - - --ion-color-tertiary: #6a64ff; - --ion-color-tertiary-rgb: 106,100,255; - --ion-color-tertiary-contrast: #ffffff; - --ion-color-tertiary-contrast-rgb: 255,255,255; - --ion-color-tertiary-shade: #5d58e0; - --ion-color-tertiary-tint: #7974ff; - - --ion-color-success: #2fdf75; - --ion-color-success-rgb: 47,223,117; - --ion-color-success-contrast: #000000; - --ion-color-success-contrast-rgb: 0,0,0; - --ion-color-success-shade: #29c467; - --ion-color-success-tint: #44e283; - - --ion-color-warning: #ffd534; - --ion-color-warning-rgb: 255,213,52; - --ion-color-warning-contrast: #000000; - --ion-color-warning-contrast-rgb: 0,0,0; - --ion-color-warning-shade: #e0bb2e; - --ion-color-warning-tint: #ffd948; - - --ion-color-danger: #ff4961; - --ion-color-danger-rgb: 255,73,97; - --ion-color-danger-contrast: #ffffff; - --ion-color-danger-contrast-rgb: 255,255,255; - --ion-color-danger-shade: #e04055; - --ion-color-danger-tint: #ff5b71; - - --ion-color-dark: #f4f5f8; - --ion-color-dark-rgb: 244,245,248; - --ion-color-dark-contrast: #000000; - --ion-color-dark-contrast-rgb: 0,0,0; - --ion-color-dark-shade: #d7d8da; - --ion-color-dark-tint: #f5f6f9; - - --ion-color-medium: #989aa2; - --ion-color-medium-rgb: 152,154,162; - --ion-color-medium-contrast: #000000; - --ion-color-medium-contrast-rgb: 0,0,0; - --ion-color-medium-shade: #86888f; - --ion-color-medium-tint: #a2a4ab; - - --ion-color-light: #222428; - --ion-color-light-rgb: 34,36,40; - --ion-color-light-contrast: #ffffff; - --ion-color-light-contrast-rgb: 255,255,255; - --ion-color-light-shade: #1e2023; - --ion-color-light-tint: #383a3e; - } - - /* - * iOS Dark Theme - * ------------------------------------------- - */ - - .ios body { - --ion-background-color: #000000; - --ion-background-color-rgb: 0,0,0; - - --ion-text-color: #ffffff; - --ion-text-color-rgb: 255,255,255; - - --ion-color-step-50: #0d0d0d; - --ion-color-step-100: #1a1a1a; - --ion-color-step-150: #262626; - --ion-color-step-200: #333333; - --ion-color-step-250: #404040; - --ion-color-step-300: #4d4d4d; - --ion-color-step-350: #595959; - --ion-color-step-400: #666666; - --ion-color-step-450: #737373; - --ion-color-step-500: #808080; - --ion-color-step-550: #8c8c8c; - --ion-color-step-600: #999999; - --ion-color-step-650: #a6a6a6; - --ion-color-step-700: #b3b3b3; - --ion-color-step-750: #bfbfbf; - --ion-color-step-800: #cccccc; - --ion-color-step-850: #d9d9d9; - --ion-color-step-900: #e6e6e6; - --ion-color-step-950: #f2f2f2; - - --ion-item-background: #000000; - - --ion-card-background: #1c1c1d; - } - - .ios ion-modal { - --ion-background-color: var(--ion-color-step-100); - --ion-toolbar-background: var(--ion-color-step-150); - --ion-toolbar-border-color: var(--ion-color-step-250); - } - - - /* - * Material Design Dark Theme - * ------------------------------------------- - */ - - .md body { - --ion-background-color: #121212; - --ion-background-color-rgb: 18,18,18; - - --ion-text-color: #ffffff; - --ion-text-color-rgb: 255,255,255; - - --ion-border-color: #222222; - - --ion-color-step-50: #1e1e1e; - --ion-color-step-100: #2a2a2a; - --ion-color-step-150: #363636; - --ion-color-step-200: #414141; - --ion-color-step-250: #4d4d4d; - --ion-color-step-300: #595959; - --ion-color-step-350: #656565; - --ion-color-step-400: #717171; - --ion-color-step-450: #7d7d7d; - --ion-color-step-500: #898989; - --ion-color-step-550: #949494; - --ion-color-step-600: #a0a0a0; - --ion-color-step-650: #acacac; - --ion-color-step-700: #b8b8b8; - --ion-color-step-750: #c4c4c4; - --ion-color-step-800: #d0d0d0; - --ion-color-step-850: #dbdbdb; - --ion-color-step-900: #e7e7e7; - --ion-color-step-950: #f3f3f3; - - --ion-item-background: #1e1e1e; - - --ion-toolbar-background: #1f1f1f; - - --ion-tab-bar-background: #1f1f1f; - - --ion-card-background: #1e1e1e; - } -} diff --git a/google-maps/e2e-tests/tests/pageobjects/basic-echo/basic-echo.page.ts b/google-maps/e2e-tests/tests/pageobjects/basic-echo/basic-echo.page.ts deleted file mode 100644 index a41920e4e..000000000 --- a/google-maps/e2e-tests/tests/pageobjects/basic-echo/basic-echo.page.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IonicButton, IonicInput } from '@ionic/e2e-components-ionic'; - -import Page from '../page'; - -class BasicEchoPage extends Page { - get runEchoButton() { - return new IonicButton('#runEchoButton'); - } - get commandOutputTextarea() { - return new IonicInput('#commandOutput'); - } -} - -export default new BasicEchoPage(); diff --git a/google-maps/e2e-tests/tests/pageobjects/map/create-and-destroy.page.ts b/google-maps/e2e-tests/tests/pageobjects/map/create-and-destroy.page.ts deleted file mode 100644 index e207d9e93..000000000 --- a/google-maps/e2e-tests/tests/pageobjects/map/create-and-destroy.page.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { IonicButton, IonicTextarea } from '@ionic/e2e-components-ionic'; - -import Page from '../page'; - -class CreateAndDestroyMapPage extends Page { - get createMapButton() { - return new IonicButton("#createMapButton"); - } - get destroyMapButton() { - return new IonicButton("#destroyMapButton"); - } - get commandOutputTextarea() { - return new IonicTextarea('#commandOutput'); - } -} - -export default new CreateAndDestroyMapPage(); \ No newline at end of file diff --git a/google-maps/e2e-tests/tests/pageobjects/markers/add-and-remove.page.ts b/google-maps/e2e-tests/tests/pageobjects/markers/add-and-remove.page.ts deleted file mode 100644 index 7f6c47d33..000000000 --- a/google-maps/e2e-tests/tests/pageobjects/markers/add-and-remove.page.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { IonicButton, IonicTextarea } from '@ionic/e2e-components-ionic'; - -import Page from "../page"; - -class AddAndRemoveMarkers extends Page { - get createMapButton() { - return new IonicButton("#createMapButton") - } - get addMarkerButton() { - return new IonicButton("#addMarkerButton") - } - get removeMarkerButton() { - return new IonicButton("#removeMarkerButton") - } - get commandOutputTextarea() { - return new IonicTextarea('#commandOutput'); - } -} - - -export default new AddAndRemoveMarkers(); \ No newline at end of file diff --git a/google-maps/e2e-tests/tests/pageobjects/markers/marker-customization.page.ts b/google-maps/e2e-tests/tests/pageobjects/markers/marker-customization.page.ts deleted file mode 100644 index 96925a375..000000000 --- a/google-maps/e2e-tests/tests/pageobjects/markers/marker-customization.page.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { IonicButton, IonicTextarea } from '@ionic/e2e-components-ionic'; - -import Page from '../page'; - -class MarkerCustomizations extends Page { - get createMapButton() { - return new IonicButton('#createMapButton'); - } - - get addMarkerImageButton() { - return new IonicButton('#addMarkerImageButton'); - } - - get addMarkerColorButton() { - return new IonicButton('#addMarkerColorButton'); - } - - get addMultipleImageMarkersButton() { - return new IonicButton('#addMultipleImageMarkersButton'); - } - - get addMultipleColorMarkersButton() { - return new IonicButton('#addMultipleColorMarkersButton'); - } - - get removeAllMarkersButton() { - return new IonicButton('#removeAllMarkersButton'); - } - - get destroyMapButton() { - return new IonicButton('#destroyMapButton'); - } - - get commandOutputTextarea() { - return new IonicTextarea('#commandOutput'); -} -} - -export default new MarkerCustomizations(); diff --git a/google-maps/e2e-tests/tests/pageobjects/markers/multiple-markers.page.ts b/google-maps/e2e-tests/tests/pageobjects/markers/multiple-markers.page.ts deleted file mode 100644 index 79f237cde..000000000 --- a/google-maps/e2e-tests/tests/pageobjects/markers/multiple-markers.page.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { IonicButton, IonicTextarea } from '@ionic/e2e-components-ionic'; - -import Page from "../page"; - -class MultipleMarkers extends Page { - get createMapButton() { - return new IonicButton("#createMapButton") - } - get addMarkersButton() { - return new IonicButton("#addMarkersButton") - } - get enableClusteringButton() { - return new IonicButton("#enableClusteringButton") - } - get disableClusteringButton() { - return new IonicButton("#disableClusteringButton") - } - get removeMarkersButton() { - return new IonicButton("#removeMarkersButton") - } - get commandOutputTextarea() { - return new IonicTextarea('#commandOutput'); - } -} - -export default new MultipleMarkers(); \ No newline at end of file diff --git a/google-maps/e2e-tests/tests/pageobjects/page.ts b/google-maps/e2e-tests/tests/pageobjects/page.ts deleted file mode 100644 index 137bf5b54..000000000 --- a/google-maps/e2e-tests/tests/pageobjects/page.ts +++ /dev/null @@ -1,23 +0,0 @@ -export default class Page { - public async hideToolBars() { - await driver.execute(() => { - for (let i = 0; i < document.getElementsByTagName('ion-toolbar').length; i++) { - const toolbar: HTMLElement | null = document.getElementsByTagName('ion-toolbar').item(i) as HTMLElement; - if (toolbar !== null) { - toolbar.style.display = 'none'; - } - } - }); - } - - public async showToolBars() { - await driver.execute(() => { - for (let i = 0; i < document.getElementsByTagName('ion-toolbar').length; i++) { - const toolbar: HTMLElement | null = document.getElementsByTagName('ion-toolbar').item(i) as HTMLElement; - if (toolbar !== null) { - toolbar.style.display = ''; - } - } - }); - } -} diff --git a/google-maps/e2e-tests/tests/specs/basic-echo/basic-echo.spec.ts b/google-maps/e2e-tests/tests/specs/basic-echo/basic-echo.spec.ts deleted file mode 100644 index e810261f0..000000000 --- a/google-maps/e2e-tests/tests/specs/basic-echo/basic-echo.spec.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as IonicE2E from '@ionic/e2e'; -import { waitForLoad, pause, setDevice, switchToWeb, url } from '@ionic/e2e'; - -import SetAndGetValuePage from '../../pageobjects/basic-echo/basic-echo.page'; - -describe.skip('Google Maps - Basic Echo', function () { - before(async function () { - await waitForLoad(); - await switchToWeb(); - await url('/basic-echo/run-basic-echo'); - await pause(500); - }); - - beforeEach(async function () { - await setDevice(IonicE2E.Device.Mobile); - await switchToWeb(); - await SetAndGetValuePage.hideToolBars(); - }); - - after(async function () { - await switchToWeb(); - await SetAndGetValuePage.showToolBars(); - await pause(500); - }); - - it('should run a basic echo from plugin.', async () => { - const runEchoButton = await SetAndGetValuePage.runEchoButton; - const commandOutput = await $((await SetAndGetValuePage.commandOutputTextarea).selector).$('textarea'); - - await runEchoButton.tap(); - await expect(commandOutput).toHaveValue('WOW!'); - }); -}); diff --git a/google-maps/e2e-tests/tests/specs/map/create-and-destroy.spec.ts b/google-maps/e2e-tests/tests/specs/map/create-and-destroy.spec.ts deleted file mode 100644 index 13aaf26bc..000000000 --- a/google-maps/e2e-tests/tests/specs/map/create-and-destroy.spec.ts +++ /dev/null @@ -1,55 +0,0 @@ -import * as IonicE2E from '@ionic/e2e'; -import { waitForLoad, pause, setDevice, switchToWeb, url } from '@ionic/e2e'; - -import CreateAndDestroyMapPage from '../../pageobjects/map/create-and-destroy.page'; - - -describe('Google Maps - Create and Destroy Map', function () { - before(async function () { - await waitForLoad(); - await switchToWeb(); - await url('/maps/create-and-destroy'); - await pause(500); - }); - - beforeEach(async function () { - await setDevice(IonicE2E.Device.Mobile); - await switchToWeb(); - await CreateAndDestroyMapPage.hideToolBars(); - }); - - after(async function () { - await switchToWeb(); - await CreateAndDestroyMapPage.showToolBars(); - await pause(500); - }); - - it('should create and destroy a map', async function() { - const createMapButton = await CreateAndDestroyMapPage.createMapButton; - const destroyMapButton = await CreateAndDestroyMapPage.destroyMapButton; - const getCommandOutputText = async function() { - return (await CreateAndDestroyMapPage.commandOutputTextarea).getValue(); - } - - await createMapButton.tap(); - await pause(500); - await expect(await getCommandOutputText()).toBe('Maps created'); - - await destroyMapButton.tap(); - await pause(500); - await expect(await getCommandOutputText()).toBe('Maps destroyed'); - }); - - it('should throw when attempting to destroy a non-existent map', async function() { - const destroyMapButton = await CreateAndDestroyMapPage.destroyMapButton; - const getCommandOutputText = async function() { - return (await CreateAndDestroyMapPage.commandOutputTextarea).getValue(); - } - - await destroyMapButton.tap(); - await pause(100); - await expect(await getCommandOutputText()).toBe('Map not found for provided id.'); - }); - - -}); diff --git a/google-maps/e2e-tests/tests/specs/markers/add-and-remove.spec.ts b/google-maps/e2e-tests/tests/specs/markers/add-and-remove.spec.ts deleted file mode 100644 index 7b398cc5a..000000000 --- a/google-maps/e2e-tests/tests/specs/markers/add-and-remove.spec.ts +++ /dev/null @@ -1,67 +0,0 @@ -import * as IonicE2E from '@ionic/e2e'; -import { waitForLoad, pause, setDevice, switchToWeb, url } from '@ionic/e2e'; - -import AddAndRemoveMarkers from '../../pageobjects/markers/add-and-remove.page'; - - -describe('Google Maps - Add and Remove Marker', function () { - let createdMarkerId = ""; - - before(async function () { - await waitForLoad(); - await switchToWeb(); - await url('/markers/add-and-remove'); - await pause(500); - }); - - beforeEach(async function () { - await setDevice(IonicE2E.Device.Mobile); - await switchToWeb(); - await AddAndRemoveMarkers.hideToolBars(); - }); - - after(async function () { - await switchToWeb(); - await AddAndRemoveMarkers.showToolBars(); - await pause(500); - }); - - it("should create a map and add a marker", async function() { - const createMapButton = await AddAndRemoveMarkers.createMapButton; - const addMarkerButton = await AddAndRemoveMarkers.addMarkerButton; - const getCommandOutputText = async function() { - return (await AddAndRemoveMarkers.commandOutputTextarea).getValue(); - } - - await createMapButton.tap(); - await pause(500); - await expect(await getCommandOutputText()).toBe('Map created'); - - await addMarkerButton.tap(); - await pause(500); - await expect(await getCommandOutputText()).toContain('Marker added: '); - - const markerId = (await getCommandOutputText()).replace("Marker added: ", ""); - await expect(markerId).not.toBeFalsy(); - - createdMarkerId = markerId; - }); - - it("should remove the created marker", async function() { - const removeMarkerButton = await AddAndRemoveMarkers.removeMarkerButton; - const commandOutput = await $((await AddAndRemoveMarkers.commandOutputTextarea).selector).$('textarea'); - - await removeMarkerButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining(`Marker removed: ${createdMarkerId}`); - }); - - it("should throw when attempting to remove a non-existent marker", async function() { - const removeMarkerButton = await AddAndRemoveMarkers.removeMarkerButton; - const commandOutput = await $((await AddAndRemoveMarkers.commandOutputTextarea).selector).$('textarea'); - - await removeMarkerButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining(`Marker not found for provided id.`); - }); -}); \ No newline at end of file diff --git a/google-maps/e2e-tests/tests/specs/markers/marker-customization.spec.ts b/google-maps/e2e-tests/tests/specs/markers/marker-customization.spec.ts deleted file mode 100644 index 4d4a80c11..000000000 --- a/google-maps/e2e-tests/tests/specs/markers/marker-customization.spec.ts +++ /dev/null @@ -1,125 +0,0 @@ -import * as IonicE2E from '@ionic/e2e'; -import { waitForLoad, pause, setDevice, switchToWeb, url } from '@ionic/e2e'; - -import MarkerCustomizations from '../../pageobjects/markers/marker-customization.page'; - -describe('Google Maps - Marker Customization', function () { - before(async function () { - await waitForLoad(); - await switchToWeb(); - await url('/markers/customizations'); - await pause(500); - }); - - beforeEach(async function () { - await setDevice(IonicE2E.Device.Mobile); - await switchToWeb(); - await MarkerCustomizations.hideToolBars(); - }); - - after(async function () { - await switchToWeb(); - await MarkerCustomizations.showToolBars(); - await pause(500); - }); - - it('should create a map and add 1 color marker', async function () { - const createMapButton = await MarkerCustomizations.createMapButton; - const removeAllMarkersButton = await MarkerCustomizations.removeAllMarkersButton; - const addColorMarkerButton = await MarkerCustomizations.addMarkerColorButton; - const commandOutput = await $( - ( - await MarkerCustomizations.commandOutputTextarea - ).selector, - ).$('textarea'); - - await createMapButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValue('Map created'); - - await addColorMarkerButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 color marker added'); - - await removeAllMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 markers removed'); - }); - - it('should create a map and add 1 image marker', async function () { - const createMapButton = await MarkerCustomizations.createMapButton; - const removeAllMarkersButton = await MarkerCustomizations.removeAllMarkersButton; - const addImageMarkerButton = await MarkerCustomizations.addMarkerImageButton; - const commandOutput = await $( - ( - await MarkerCustomizations.commandOutputTextarea - ).selector, - ).$('textarea'); - - await createMapButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValue('Map created'); - - await addImageMarkerButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 image marker added'); - - await removeAllMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 markers removed'); - }); - - it('should add 1 image marker', async function () { - const removeAllMarkersButton = await MarkerCustomizations.removeAllMarkersButton; - const addImageMarkerButton = await MarkerCustomizations.addMarkerImageButton; - const commandOutput = await $( - ( - await MarkerCustomizations.commandOutputTextarea - ).selector, - ).$('textarea'); - - await addImageMarkerButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 image marker added'); - - await removeAllMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('1 markers removed'); - }); - - it('should add 4 image markers', async function () { - const removeAllMarkersButton = await MarkerCustomizations.removeAllMarkersButton; - const addMultipleImageMarkersButton = await MarkerCustomizations.addMultipleImageMarkersButton; - const commandOutput = await $( - ( - await MarkerCustomizations.commandOutputTextarea - ).selector, - ).$('textarea'); - - await addMultipleImageMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('4 image markers added'); - - await removeAllMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('4 markers removed'); - }); - - it('should add 4 color markers', async function () { - const removeAllMarkersButton = await MarkerCustomizations.removeAllMarkersButton; - const addMultipleColorMarkersButton = await MarkerCustomizations.addMultipleColorMarkersButton; - const commandOutput = await $( - ( - await MarkerCustomizations.commandOutputTextarea - ).selector, - ).$('textarea'); - - await addMultipleColorMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('4 color markers added'); - - await removeAllMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('4 markers removed'); - }); -}); diff --git a/google-maps/e2e-tests/tests/specs/markers/multiple-markers.spec.ts b/google-maps/e2e-tests/tests/specs/markers/multiple-markers.spec.ts deleted file mode 100644 index f1d2b3e56..000000000 --- a/google-maps/e2e-tests/tests/specs/markers/multiple-markers.spec.ts +++ /dev/null @@ -1,71 +0,0 @@ -import * as IonicE2E from '@ionic/e2e'; -import { waitForLoad, pause, setDevice, switchToWeb, url } from '@ionic/e2e'; - -import MultipleMarkers from '../../pageobjects/markers/multiple-markers.page'; - -describe('Google Maps - Multiple Markers', function () { - before(async function () { - await waitForLoad(); - await switchToWeb(); - await url('/markers/multiple-markers'); - await pause(500); - }); - - beforeEach(async function () { - await setDevice(IonicE2E.Device.Mobile); - await switchToWeb(); - await MultipleMarkers.hideToolBars(); - }); - - after(async function () { - await switchToWeb(); - await MultipleMarkers.showToolBars(); - await pause(500); - }); - - it("should create a map and add 4 markers", async function() { - const createMapButton = await MultipleMarkers.createMapButton; - const addMarkersButton = await MultipleMarkers.addMarkersButton; - const commandOutput = await $((await MultipleMarkers.commandOutputTextarea).selector).$('textarea'); - - await createMapButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValue('Map created'); - - await addMarkersButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValueContaining('4 markers added'); - }) - - it("should enable and disable clustering", async function() { - const enableClusteringButton = await MultipleMarkers.enableClusteringButton; - const disableClusteringButton = await MultipleMarkers.disableClusteringButton; - const commandOutput = await $((await MultipleMarkers.commandOutputTextarea).selector).$('textarea'); - - await enableClusteringButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValue('marker clustering enabled'); - - await disableClusteringButton.tap(); - await pause(500); - await expect(commandOutput).toHaveValue('marker clustering disabled'); - }) - - it("should remove 4 markers", async function() { - const removeMarkersButton = await MultipleMarkers.removeMarkersButton; - const commandOutput = await $((await MultipleMarkers.commandOutputTextarea).selector).$('textarea'); - - await removeMarkersButton.tap() - await pause(500); - await expect(commandOutput).toHaveValue('4 markers removed'); - }) - - it("should throw error when attempting to remove no markers", async function() { - const removeMarkersButton = await MultipleMarkers.removeMarkersButton; - const commandOutput = await $((await MultipleMarkers.commandOutputTextarea).selector).$('textarea'); - - await removeMarkersButton.tap() - await pause(500); - await expect(commandOutput).toHaveValue('Invalid Arguments Provided: markerIds requires at least one marker id.'); - }) -}) \ No newline at end of file diff --git a/google-maps/e2e-tests/tsconfig.json b/google-maps/e2e-tests/tsconfig.json deleted file mode 100644 index a273b0cfc..000000000 --- a/google-maps/e2e-tests/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx" - }, - "include": [ - "src" - ] -} diff --git a/google-maps/ios/Plugin.xcodeproj/project.pbxproj b/google-maps/ios/Plugin.xcodeproj/project.pbxproj deleted file mode 100644 index 19307faa8..000000000 --- a/google-maps/ios/Plugin.xcodeproj/project.pbxproj +++ /dev/null @@ -1,641 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 48; - objects = { - -/* Begin PBXBuildFile section */ - 0238AED727C931A40012930B /* GoogleMapCameraConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0238AED627C931A40012930B /* GoogleMapCameraConfig.swift */; }; - 0238AED927C945840012930B /* GoogleMapPadding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0238AED827C945840012930B /* GoogleMapPadding.swift */; }; - 02404C8D279F408800CEF8C8 /* GoogleMapErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02404C8C279F408800CEF8C8 /* GoogleMapErrors.swift */; }; - 02404C8F279F43E900CEF8C8 /* GoogleMapConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02404C8E279F43E900CEF8C8 /* GoogleMapConfig.swift */; }; - 02B55EAC29E9AAAA00493664 /* Polygon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02B55EAB29E9AAAA00493664 /* Polygon.swift */; }; - 02B55EAE29EA0CF000493664 /* Circle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02B55EAD29EA0CF000493664 /* Circle.swift */; }; - 0244BF2C29DB68DF00A06018 /* Polyline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0244BF2B29DB68DF00A06018 /* Polyline.swift */; }; - 02C012C327A9D20200FAAE78 /* Marker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02C012C227A9D20200FAAE78 /* Marker.swift */; }; - 02C6EDF22798803E00D51BF6 /* Map.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02C6EDF12798803E00D51BF6 /* Map.swift */; }; - 03FC29A292ACC40490383A1F /* Pods_Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */; }; - 20C0B05DCFC8E3958A738AF2 /* Pods_PluginTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */; }; - 50ADFF92201F53D600D50D53 /* Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFF88201F53D600D50D53 /* Plugin.framework */; }; - 50ADFF97201F53D600D50D53 /* CapacitorGoogleMapsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFF96201F53D600D50D53 /* CapacitorGoogleMapsTests.swift */; }; - 50ADFF99201F53D600D50D53 /* CapacitorGoogleMapsPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ADFF8B201F53D600D50D53 /* CapacitorGoogleMapsPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 50ADFFA42020D75100D50D53 /* Capacitor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFFA52020D75100D50D53 /* Capacitor.framework */; }; - 50ADFFA82020EE4F00D50D53 /* CapacitorGoogleMapsPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFFA72020EE4F00D50D53 /* CapacitorGoogleMapsPlugin.m */; }; - 50E1A94820377CB70090CE1A /* CapacitorGoogleMapsPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50E1A94720377CB70090CE1A /* CapacitorGoogleMapsPlugin.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 50ADFF93201F53D600D50D53 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 50ADFF7F201F53D600D50D53 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 50ADFF87201F53D600D50D53; - remoteInfo = Plugin; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 0238AED627C931A40012930B /* GoogleMapCameraConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleMapCameraConfig.swift; sourceTree = ""; }; - 0238AED827C945840012930B /* GoogleMapPadding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleMapPadding.swift; sourceTree = ""; }; - 02404C8C279F408800CEF8C8 /* GoogleMapErrors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleMapErrors.swift; sourceTree = ""; }; - 02404C8E279F43E900CEF8C8 /* GoogleMapConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleMapConfig.swift; sourceTree = ""; }; - 02B55EAB29E9AAAA00493664 /* Polygon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Polygon.swift; sourceTree = ""; }; - 02B55EAD29EA0CF000493664 /* Circle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Circle.swift; sourceTree = ""; }; - 0244BF2B29DB68DF00A06018 /* Polyline.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Polyline.swift; sourceTree = ""; }; - 02C012C227A9D20200FAAE78 /* Marker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Marker.swift; sourceTree = ""; }; - 02C6EDF12798803E00D51BF6 /* Map.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Map.swift; sourceTree = ""; }; - 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 50ADFF88201F53D600D50D53 /* Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 50ADFF8B201F53D600D50D53 /* CapacitorGoogleMapsPlugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CapacitorGoogleMapsPlugin.h; sourceTree = ""; }; - 50ADFF8C201F53D600D50D53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 50ADFF91201F53D600D50D53 /* PluginTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PluginTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 50ADFF96201F53D600D50D53 /* CapacitorGoogleMapsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CapacitorGoogleMapsTests.swift; sourceTree = ""; }; - 50ADFF98201F53D600D50D53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 50ADFFA52020D75100D50D53 /* Capacitor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Capacitor.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 50ADFFA72020EE4F00D50D53 /* CapacitorGoogleMapsPlugin.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CapacitorGoogleMapsPlugin.m; sourceTree = ""; }; - 50E1A94720377CB70090CE1A /* CapacitorGoogleMapsPlugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CapacitorGoogleMapsPlugin.swift; sourceTree = ""; }; - 5E23F77F099397094342571A /* Pods-Plugin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig"; sourceTree = ""; }; - 91781294A431A2A7CC6EB714 /* Pods-Plugin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.release.xcconfig"; path = "Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig"; sourceTree = ""; }; - 96ED1B6440D6672E406C8D19 /* Pods-PluginTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PluginTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig"; sourceTree = ""; }; - F65BB2953ECE002E1EF3E424 /* Pods-PluginTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PluginTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig"; sourceTree = ""; }; - F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PluginTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 50ADFF84201F53D600D50D53 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 50ADFFA42020D75100D50D53 /* Capacitor.framework in Frameworks */, - 03FC29A292ACC40490383A1F /* Pods_Plugin.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 50ADFF8E201F53D600D50D53 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 50ADFF92201F53D600D50D53 /* Plugin.framework in Frameworks */, - 20C0B05DCFC8E3958A738AF2 /* Pods_PluginTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 50ADFF7E201F53D600D50D53 = { - isa = PBXGroup; - children = ( - 50ADFF8A201F53D600D50D53 /* Plugin */, - 50ADFF95201F53D600D50D53 /* PluginTests */, - 50ADFF89201F53D600D50D53 /* Products */, - 8C8E7744173064A9F6D438E3 /* Pods */, - A797B9EFA3DCEFEA1FBB66A9 /* Frameworks */, - ); - sourceTree = ""; - }; - 50ADFF89201F53D600D50D53 /* Products */ = { - isa = PBXGroup; - children = ( - 50ADFF88201F53D600D50D53 /* Plugin.framework */, - 50ADFF91201F53D600D50D53 /* PluginTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 50ADFF8A201F53D600D50D53 /* Plugin */ = { - isa = PBXGroup; - children = ( - 50E1A94720377CB70090CE1A /* CapacitorGoogleMapsPlugin.swift */, - 02C6EDF12798803E00D51BF6 /* Map.swift */, - 50ADFF8B201F53D600D50D53 /* CapacitorGoogleMapsPlugin.h */, - 50ADFFA72020EE4F00D50D53 /* CapacitorGoogleMapsPlugin.m */, - 50ADFF8C201F53D600D50D53 /* Info.plist */, - 02404C8C279F408800CEF8C8 /* GoogleMapErrors.swift */, - 02404C8E279F43E900CEF8C8 /* GoogleMapConfig.swift */, - 02C012C227A9D20200FAAE78 /* Marker.swift */, - 0238AED627C931A40012930B /* GoogleMapCameraConfig.swift */, - 0238AED827C945840012930B /* GoogleMapPadding.swift */, - 02B55EAB29E9AAAA00493664 /* Polygon.swift */, - 02B55EAD29EA0CF000493664 /* Circle.swift */, - 0244BF2B29DB68DF00A06018 /* Polyline.swift */, - ); - path = Plugin; - sourceTree = ""; - }; - 50ADFF95201F53D600D50D53 /* PluginTests */ = { - isa = PBXGroup; - children = ( - 50ADFF96201F53D600D50D53 /* CapacitorGoogleMapsTests.swift */, - 50ADFF98201F53D600D50D53 /* Info.plist */, - ); - path = PluginTests; - sourceTree = ""; - }; - 8C8E7744173064A9F6D438E3 /* Pods */ = { - isa = PBXGroup; - children = ( - 5E23F77F099397094342571A /* Pods-Plugin.debug.xcconfig */, - 91781294A431A2A7CC6EB714 /* Pods-Plugin.release.xcconfig */, - 96ED1B6440D6672E406C8D19 /* Pods-PluginTests.debug.xcconfig */, - F65BB2953ECE002E1EF3E424 /* Pods-PluginTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - A797B9EFA3DCEFEA1FBB66A9 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 50ADFFA52020D75100D50D53 /* Capacitor.framework */, - 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */, - F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 50ADFF85201F53D600D50D53 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 50ADFF99201F53D600D50D53 /* CapacitorGoogleMapsPlugin.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 50ADFF87201F53D600D50D53 /* Plugin */ = { - isa = PBXNativeTarget; - buildConfigurationList = 50ADFF9C201F53D600D50D53 /* Build configuration list for PBXNativeTarget "Plugin" */; - buildPhases = ( - AB5B3E54B4E897F32C2279DA /* [CP] Check Pods Manifest.lock */, - 50ADFF83201F53D600D50D53 /* Sources */, - 50ADFF84201F53D600D50D53 /* Frameworks */, - 50ADFF85201F53D600D50D53 /* Headers */, - 50ADFF86201F53D600D50D53 /* Resources */, - 27D2989C782FE41D4C77DB9C /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Plugin; - productName = Plugin; - productReference = 50ADFF88201F53D600D50D53 /* Plugin.framework */; - productType = "com.apple.product-type.framework"; - }; - 50ADFF90201F53D600D50D53 /* PluginTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 50ADFF9F201F53D600D50D53 /* Build configuration list for PBXNativeTarget "PluginTests" */; - buildPhases = ( - 0596884F929ED6F1DE134961 /* [CP] Check Pods Manifest.lock */, - 50ADFF8D201F53D600D50D53 /* Sources */, - 50ADFF8E201F53D600D50D53 /* Frameworks */, - 50ADFF8F201F53D600D50D53 /* Resources */, - 8E97F58B69A94C6503FC9C85 /* [CP] Embed Pods Frameworks */, - 387C5C3A5D666D8067A600EA /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 50ADFF94201F53D600D50D53 /* PBXTargetDependency */, - ); - name = PluginTests; - productName = PluginTests; - productReference = 50ADFF91201F53D600D50D53 /* PluginTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 50ADFF7F201F53D600D50D53 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1160; - ORGANIZATIONNAME = "Max Lynch"; - TargetAttributes = { - 50ADFF87201F53D600D50D53 = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - }; - 50ADFF90201F53D600D50D53 = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = 50ADFF82201F53D600D50D53 /* Build configuration list for PBXProject "Plugin" */; - compatibilityVersion = "Xcode 8.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 50ADFF7E201F53D600D50D53; - productRefGroup = 50ADFF89201F53D600D50D53 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 50ADFF87201F53D600D50D53 /* Plugin */, - 50ADFF90201F53D600D50D53 /* PluginTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 50ADFF86201F53D600D50D53 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 50ADFF8F201F53D600D50D53 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 0596884F929ED6F1DE134961 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PluginTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 27D2989C782FE41D4C77DB9C /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Plugin/Pods-Plugin-resources.sh", - "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64/GoogleMaps.framework/Resources/GoogleMaps.bundle", - "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64_x86_64-simulator/GoogleMaps.framework/Resources/GoogleMaps.bundle", - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMaps.bundle", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Plugin/Pods-Plugin-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 387C5C3A5D666D8067A600EA /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PluginTests/Pods-PluginTests-resources.sh", - "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64/GoogleMaps.framework/Resources/GoogleMaps.bundle", - "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64_x86_64-simulator/GoogleMaps.framework/Resources/GoogleMaps.bundle", - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMaps.bundle", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PluginTests/Pods-PluginTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 8E97F58B69A94C6503FC9C85 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Capacitor/Capacitor.framework", - "${BUILT_PRODUCTS_DIR}/CapacitorCordova/Cordova.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Capacitor.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cordova.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - AB5B3E54B4E897F32C2279DA /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Plugin-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 50ADFF83201F53D600D50D53 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 0244BF2C29DB68DF00A06018 /* Polyline.swift in Sources */, - 02404C8D279F408800CEF8C8 /* GoogleMapErrors.swift in Sources */, - 50E1A94820377CB70090CE1A /* CapacitorGoogleMapsPlugin.swift in Sources */, - 0238AED727C931A40012930B /* GoogleMapCameraConfig.swift in Sources */, - 0238AED927C945840012930B /* GoogleMapPadding.swift in Sources */, - 02404C8F279F43E900CEF8C8 /* GoogleMapConfig.swift in Sources */, - 02B55EAE29EA0CF000493664 /* Circle.swift in Sources */, - 02B55EAC29E9AAAA00493664 /* Polygon.swift in Sources */, - 02C6EDF22798803E00D51BF6 /* Map.swift in Sources */, - 50ADFFA82020EE4F00D50D53 /* CapacitorGoogleMapsPlugin.m in Sources */, - 02C012C327A9D20200FAAE78 /* Marker.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 50ADFF8D201F53D600D50D53 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 50ADFF97201F53D600D50D53 /* CapacitorGoogleMapsTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 50ADFF94201F53D600D50D53 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 50ADFF87201F53D600D50D53 /* Plugin */; - targetProxy = 50ADFF93201F53D600D50D53 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 50ADFF9A201F53D600D50D53 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - FRAMEWORK_SEARCH_PATHS = ( - "\"${BUILT_PRODUCTS_DIR}/Capacitor\"", - "\"${BUILT_PRODUCTS_DIR}/CapacitorCordova\"", - ); - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 50ADFF9B201F53D600D50D53 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - FRAMEWORK_SEARCH_PATHS = ( - "\"${BUILT_PRODUCTS_DIR}/Capacitor\"", - "\"${BUILT_PRODUCTS_DIR}/CapacitorCordova\"", - ); - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 50ADFF9D201F53D600D50D53 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5E23F77F099397094342571A /* Pods-Plugin.debug.xcconfig */; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - CODE_SIGN_STYLE = Automatic; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Plugin/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)\n$(FRAMEWORK_SEARCH_PATHS)\n$(FRAMEWORK_SEARCH_PATHS)"; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.Plugin; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 50ADFF9E201F53D600D50D53 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 91781294A431A2A7CC6EB714 /* Pods-Plugin.release.xcconfig */; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - CODE_SIGN_STYLE = Automatic; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Plugin/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)"; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.Plugin; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 50ADFFA0201F53D600D50D53 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 96ED1B6440D6672E406C8D19 /* Pods-PluginTests.debug.xcconfig */; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - INFOPLIST_FILE = PluginTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.PluginTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 50ADFFA1201F53D600D50D53 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F65BB2953ECE002E1EF3E424 /* Pods-PluginTests.release.xcconfig */; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - INFOPLIST_FILE = PluginTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.PluginTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 50ADFF82201F53D600D50D53 /* Build configuration list for PBXProject "Plugin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 50ADFF9A201F53D600D50D53 /* Debug */, - 50ADFF9B201F53D600D50D53 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 50ADFF9C201F53D600D50D53 /* Build configuration list for PBXNativeTarget "Plugin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 50ADFF9D201F53D600D50D53 /* Debug */, - 50ADFF9E201F53D600D50D53 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 50ADFF9F201F53D600D50D53 /* Build configuration list for PBXNativeTarget "PluginTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 50ADFFA0201F53D600D50D53 /* Debug */, - 50ADFFA1201F53D600D50D53 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 50ADFF7F201F53D600D50D53 /* Project object */; -} diff --git a/google-maps/ios/Plugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/google-maps/ios/Plugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a62..000000000 --- a/google-maps/ios/Plugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/google-maps/ios/Plugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/google-maps/ios/Plugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/google-maps/ios/Plugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/google-maps/ios/Plugin.xcodeproj/xcshareddata/xcschemes/Plugin.xcscheme b/google-maps/ios/Plugin.xcodeproj/xcshareddata/xcschemes/Plugin.xcscheme deleted file mode 100644 index 303f2621b..000000000 --- a/google-maps/ios/Plugin.xcodeproj/xcshareddata/xcschemes/Plugin.xcscheme +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/google-maps/ios/Plugin.xcodeproj/xcshareddata/xcschemes/PluginTests.xcscheme b/google-maps/ios/Plugin.xcodeproj/xcshareddata/xcschemes/PluginTests.xcscheme deleted file mode 100644 index 3d8c88d25..000000000 --- a/google-maps/ios/Plugin.xcodeproj/xcshareddata/xcschemes/PluginTests.xcscheme +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/google-maps/ios/Plugin.xcworkspace/contents.xcworkspacedata b/google-maps/ios/Plugin.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index afad624ec..000000000 --- a/google-maps/ios/Plugin.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/google-maps/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/google-maps/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/google-maps/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/google-maps/ios/Plugin/CapacitorGoogleMapsPlugin.h b/google-maps/ios/Plugin/CapacitorGoogleMapsPlugin.h deleted file mode 100644 index f2bd9e0bb..000000000 --- a/google-maps/ios/Plugin/CapacitorGoogleMapsPlugin.h +++ /dev/null @@ -1,10 +0,0 @@ -#import - -//! Project version number for Plugin. -FOUNDATION_EXPORT double PluginVersionNumber; - -//! Project version string for Plugin. -FOUNDATION_EXPORT const unsigned char PluginVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - diff --git a/google-maps/ios/Plugin/CapacitorGoogleMapsPlugin.m b/google-maps/ios/Plugin/CapacitorGoogleMapsPlugin.m deleted file mode 100644 index 4ae033d08..000000000 --- a/google-maps/ios/Plugin/CapacitorGoogleMapsPlugin.m +++ /dev/null @@ -1,38 +0,0 @@ -#import -#import - -// Define the plugin using the CAP_PLUGIN Macro, and -// each method the plugin supports using the CAP_PLUGIN_METHOD macro. -CAP_PLUGIN(CapacitorGoogleMapsPlugin, "CapacitorGoogleMaps", - CAP_PLUGIN_METHOD(create, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(enableTouch, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(disableTouch, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(addMarker, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(addMarkers, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(addPolygons, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(addPolylines, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(addCircles, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(removeMarker, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(removeMarkers, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(removeCircles, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(removePolygons, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(removePolylines, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(enableClustering, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(disableClustering, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(destroy, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(setCamera, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(getMapType, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(setMapType, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(enableIndoorMaps, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(enableTrafficLayer, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(enableAccessibilityElements, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(enableCurrentLocation, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(setPadding, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(onScroll, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(onResize, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(onDisplay, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(getMapBounds, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(fitBounds, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(mapBoundsContains, CAPPluginReturnPromise); - CAP_PLUGIN_METHOD(mapBoundsExtend, CAPPluginReturnPromise); -) diff --git a/google-maps/ios/Plugin/CapacitorGoogleMapsPlugin.swift b/google-maps/ios/Plugin/CapacitorGoogleMapsPlugin.swift deleted file mode 100644 index 59af66ba8..000000000 --- a/google-maps/ios/Plugin/CapacitorGoogleMapsPlugin.swift +++ /dev/null @@ -1,1191 +0,0 @@ -// swiftlint:disable file_length -import Foundation -import Capacitor -import GoogleMaps -import GoogleMapsUtils - -extension GMSMapViewType { - static func fromString(mapType: String) -> GMSMapViewType { - switch mapType { - case "Normal": - return .normal - case "Hybrid": - return .hybrid - case "Satellite": - return .satellite - case "Terrain": - return .terrain - case "None": - return .none - default: - print("CapacitorGoogleMaps Warning: unknown mapView type '\(mapType)'. Defaulting to normal.") - return .normal - } - } - static func toString(mapType: GMSMapViewType) -> String { - switch mapType { - case .normal: - return "Normal" - case .hybrid: - return "Hybrid" - case .satellite: - return "Satellite" - case .terrain: - return "Terrain" - case .none: - return "None" - default: - return "Normal" - } - } -} - -extension CGRect { - static func fromJSObject(_ jsObject: JSObject) throws -> CGRect { - guard let width = jsObject["width"] as? Double else { - throw GoogleMapErrors.invalidArguments("bounds object is missing the required 'width' property") - } - - guard let height = jsObject["height"] as? Double else { - throw GoogleMapErrors.invalidArguments("bounds object is missing the required 'height' property") - } - - guard let x = jsObject["x"] as? Double else { - throw GoogleMapErrors.invalidArguments("bounds object is missing the required 'x' property") - } - - guard let y = jsObject["y"] as? Double else { - throw GoogleMapErrors.invalidArguments("bounds object is missing the required 'y' property") - } - - return CGRect(x: x, y: y, width: width, height: height) - } -} - -// swiftlint:disable type_body_length -@objc(CapacitorGoogleMapsPlugin) -public class CapacitorGoogleMapsPlugin: CAPPlugin, GMSMapViewDelegate { - private var maps = [String: Map]() - private var isInitialized = false - - func checkLocationPermission() -> String { - let locationState: String - - switch CLLocationManager.authorizationStatus() { - case .notDetermined: - locationState = "prompt" - case .restricted, .denied: - locationState = "denied" - case .authorizedAlways, .authorizedWhenInUse: - locationState = "granted" - @unknown default: - locationState = "prompt" - } - - return locationState - } - - @objc func create(_ call: CAPPluginCall) { - do { - if !isInitialized { - guard let apiKey = call.getString("apiKey") else { - throw GoogleMapErrors.invalidAPIKey - } - - GMSServices.provideAPIKey(apiKey) - isInitialized = true - } - - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let configObj = call.getObject("config") else { - throw GoogleMapErrors.invalidArguments("config object is missing") - } - - let forceCreate = call.getBool("forceCreate", false) - - let config = try GoogleMapConfig(fromJSObject: configObj) - - if self.maps[id] != nil { - if !forceCreate { - call.resolve() - return - } - - let removedMap = self.maps.removeValue(forKey: id) - removedMap?.destroy() - } - - DispatchQueue.main.sync { - let newMap = Map(id: id, config: config, delegate: self) - self.maps[id] = newMap - } - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func destroy(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let removedMap = self.maps.removeValue(forKey: id) else { - throw GoogleMapErrors.mapNotFound - } - - removedMap.destroy() - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func enableTouch(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - map.enableTouch() - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func disableTouch(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - map.disableTouch() - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func addMarker(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let markerObj = call.getObject("marker") else { - throw GoogleMapErrors.invalidArguments("marker object is missing") - } - - let marker = try Marker(fromJSObject: markerObj) - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - let markerId = try map.addMarker(marker: marker) - - call.resolve(["id": String(markerId)]) - - } catch { - handleError(call, error: error) - } - } - - @objc func addMarkers(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let markerObjs = call.getArray("markers") as? [JSObject] else { - throw GoogleMapErrors.invalidArguments("markers array is missing") - } - - if markerObjs.isEmpty { - throw GoogleMapErrors.invalidArguments("markers requires at least one marker") - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - var markers: [Marker] = [] - - try markerObjs.forEach { marker in - let marker = try Marker(fromJSObject: marker) - markers.append(marker) - } - - let ids = try map.addMarkers(markers: markers) - - call.resolve(["ids": ids.map({ id in - return String(id) - })]) - - } catch { - handleError(call, error: error) - } - } - - @objc func removeMarkers(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let markerIdStrings = call.getArray("markerIds") as? [String] else { - throw GoogleMapErrors.invalidArguments("markerIds are invalid or missing") - } - - if markerIdStrings.isEmpty { - throw GoogleMapErrors.invalidArguments("markerIds requires at least one marker id") - } - - let ids: [Int] = try markerIdStrings.map { idString in - guard let markerId = Int(idString) else { - throw GoogleMapErrors.invalidArguments("markerIds are invalid or missing") - } - - return markerId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - try map.removeMarkers(ids: ids) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func removeMarker(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let markerIdString = call.getString("markerId") else { - throw GoogleMapErrors.invalidArguments("markerId is invalid or missing") - } - - guard let markerId = Int(markerIdString) else { - throw GoogleMapErrors.invalidArguments("markerId is invalid or missing") - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - try map.removeMarker(id: markerId) - - call.resolve() - - } catch { - handleError(call, error: error) - } - } - - @objc func addPolygons(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let shapeObjs = call.getArray("polygons") as? [JSObject] else { - throw GoogleMapErrors.invalidArguments("polygons array is missing") - } - - if shapeObjs.isEmpty { - throw GoogleMapErrors.invalidArguments("polygons requires at least one shape") - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - var shapes: [Polygon] = [] - - try shapeObjs.forEach { shapeObj in - let polygon = try Polygon(fromJSObject: shapeObj) - shapes.append(polygon) - } - - let ids = try map.addPolygons(polygons: shapes) - - call.resolve(["ids": ids.map({ id in - return String(id) - })]) - } catch { - handleError(call, error: error) - } - } - - @objc func addPolylines(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let lineObjs = call.getArray("polylines") as? [JSObject] else { - throw GoogleMapErrors.invalidArguments("polylines array is missing") - } - - if lineObjs.isEmpty { - throw GoogleMapErrors.invalidArguments("polylines requires at least one line") - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - var lines: [Polyline] = [] - - try lineObjs.forEach { lineObj in - let line = try Polyline(fromJSObject: lineObj) - lines.append(line) - } - - let ids = try map.addPolylines(lines: lines) - - call.resolve(["ids": ids.map({ id in - return String(id) - })]) - } catch { - handleError(call, error: error) - } - } - - @objc func removePolygons(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let polygonIdsStrings = call.getArray("polygonIds") as? [String] else { - throw GoogleMapErrors.invalidArguments("polygonIds are invalid or missing") - } - - if polygonIdsStrings.isEmpty { - throw GoogleMapErrors.invalidArguments("polygonIds requires at least one polygon id") - } - - let ids: [Int] = try polygonIdsStrings.map { idString in - guard let polygonId = Int(idString) else { - throw GoogleMapErrors.invalidArguments("polygonIds are invalid or missing") - } - - return polygonId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - try map.removePolygons(ids: ids) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func addCircles(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let circleObjs = call.getArray("circles") as? [JSObject] else { - throw GoogleMapErrors.invalidArguments("circles array is missing") - } - - if circleObjs.isEmpty { - throw GoogleMapErrors.invalidArguments("circles requires at least one circle") - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - var circles: [Circle] = [] - - try circleObjs.forEach { circleObj in - let circle = try Circle(from: circleObj) - circles.append(circle) - } - - let ids = try map.addCircles(circles: circles) - - call.resolve(["ids": ids.map({ id in - return String(id) - })]) - } catch { - handleError(call, error: error) - } - } - - @objc func removeCircles(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let circleIdsStrings = call.getArray("circleIds") as? [String] else { - throw GoogleMapErrors.invalidArguments("circleIds are invalid or missing") - } - - if circleIdsStrings.isEmpty { - throw GoogleMapErrors.invalidArguments("circleIds requires at least one cicle id") - } - - let ids: [Int] = try circleIdsStrings.map { idString in - guard let circleId = Int(idString) else { - throw GoogleMapErrors.invalidArguments("circleIds are invalid or missing") - } - - return circleId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - try map.removeCircles(ids: ids) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func removePolylines(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let polylineIdsStrings = call.getArray("polylineIds") as? [String] else { - throw GoogleMapErrors.invalidArguments("polylineIds are invalid or missing") - } - - if polylineIdsStrings.isEmpty { - throw GoogleMapErrors.invalidArguments("polylineIds requires at least one polyline id") - } - - let ids: [Int] = try polylineIdsStrings.map { idString in - guard let polylineId = Int(idString) else { - throw GoogleMapErrors.invalidArguments("polylineIds are invalid or missing") - } - - return polylineId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - try map.removePolylines(ids: ids) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func setCamera(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - guard let configObj = call.getObject("config") else { - throw GoogleMapErrors.invalidArguments("config object is missing") - } - - let config = try GoogleMapCameraConfig(fromJSObject: configObj) - - try map.setCamera(config: config) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func getMapType(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - let mapType = GMSMapViewType.toString(mapType: map.getMapType()) - - call.resolve([ - "type": mapType - ]) - } catch { - handleError(call, error: error) - } - } - - @objc func setMapType(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - guard let mapTypeString = call.getString("mapType") else { - throw GoogleMapErrors.invalidArguments("mapType is missing") - } - - let mapType = GMSMapViewType.fromString(mapType: mapTypeString) - - try map.setMapType(mapType: mapType) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func enableIndoorMaps(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - guard let enabled = call.getBool("enabled") else { - throw GoogleMapErrors.invalidArguments("enabled is missing") - } - - try map.enableIndoorMaps(enabled: enabled) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func enableTrafficLayer(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - guard let enabled = call.getBool("enabled") else { - throw GoogleMapErrors.invalidArguments("enabled is missing") - } - - try map.enableTrafficLayer(enabled: enabled) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func enableAccessibilityElements(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - guard let enabled = call.getBool("enabled") else { - throw GoogleMapErrors.invalidArguments("enabled is missing") - } - - try map.enableAccessibilityElements(enabled: enabled) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func setPadding(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - guard let configObj = call.getObject("padding") else { - throw GoogleMapErrors.invalidArguments("padding is missing") - } - - let padding = try GoogleMapPadding.init(fromJSObject: configObj) - - try map.setPadding(padding: padding) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func enableCurrentLocation(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - guard let enabled = call.getBool("enabled") else { - throw GoogleMapErrors.invalidArguments("enabled is missing") - } - - if enabled && checkLocationPermission() != "granted" { - throw GoogleMapErrors.permissionsDeniedLocation - } - - try map.enableCurrentLocation(enabled: enabled) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func enableClustering(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - let minClusterSize = call.getInt("minClusterSize") - - map.enableClustering(minClusterSize) - call.resolve() - - } catch { - handleError(call, error: error) - } - } - - @objc func disableClustering(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - map.disableClustering() - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func onScroll(_ call: CAPPluginCall) { - call.unavailable("not supported on iOS") - } - - @objc func onResize(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - guard let mapBoundsObj = call.getObject("mapBounds") else { - throw GoogleMapErrors.invalidArguments("map bounds not set") - } - - let mapBounds = try CGRect.fromJSObject(mapBoundsObj) - - map.updateRender(mapBounds: mapBounds) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func onDisplay(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - guard let mapBoundsObj = call.getObject("mapBounds") else { - throw GoogleMapErrors.invalidArguments("map bounds not set") - } - - let mapBounds = try CGRect.fromJSObject(mapBoundsObj) - - map.rebindTargetContainer(mapBounds: mapBounds) - - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func getMapBounds(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - try DispatchQueue.main.sync { - guard let bounds = map.getMapLatLngBounds() else { - throw GoogleMapErrors.unhandledError("Google Map Bounds could not be found.") - } - - call.resolve( - formatMapBoundsForResponse( - bounds: bounds, - cameraPosition: map.mapViewController.GMapView.camera - ) - ) - } - } catch { - handleError(call, error: error) - } - } - - @objc func mapBoundsContains(_ call: CAPPluginCall) { - do { - guard let boundsObject = call.getObject("bounds") else { - throw GoogleMapErrors.invalidArguments("Invalid bounds provided") - } - - guard let pointObject = call.getObject("point") else { - throw GoogleMapErrors.invalidArguments("Invalid point provided") - } - - let bounds = try getGMSCoordinateBounds(boundsObject) - let point = try getCLLocationCoordinate(pointObject) - - call.resolve([ - "contains": bounds.contains(point) - ]) - } catch { - handleError(call, error: error) - } - } - - @objc func fitBounds(_ call: CAPPluginCall) { - do { - guard let id = call.getString("id") else { - throw GoogleMapErrors.invalidMapId - } - - guard let map = self.maps[id] else { - throw GoogleMapErrors.mapNotFound - } - - guard let boundsObject = call.getObject("bounds") else { - throw GoogleMapErrors.invalidArguments("Invalid bounds provided") - } - - let bounds = try getGMSCoordinateBounds(boundsObject) - let padding = CGFloat(call.getInt("padding", 0)) - - map.fitBounds(bounds: bounds, padding: padding) - call.resolve() - } catch { - handleError(call, error: error) - } - } - - @objc func mapBoundsExtend(_ call: CAPPluginCall) { - do { - guard let boundsObject = call.getObject("bounds") else { - throw GoogleMapErrors.invalidArguments("Invalid bounds provided") - } - - guard let pointObject = call.getObject("point") else { - throw GoogleMapErrors.invalidArguments("Invalid point provided") - } - - let bounds = try getGMSCoordinateBounds(boundsObject) - let point = try getCLLocationCoordinate(pointObject) - - DispatchQueue.main.sync { - let newBounds = bounds.includingCoordinate(point) - call.resolve([ - "bounds": formatMapBoundsForResponse(newBounds) - ]) - } - } catch { - handleError(call, error: error) - } - } - - private func getGMSCoordinateBounds(_ bounds: JSObject) throws -> GMSCoordinateBounds { - guard let southwest = bounds["southwest"] as? JSObject else { - throw GoogleMapErrors.unhandledError("Bounds southwest property not formatted properly.") - } - - guard let northeast = bounds["northeast"] as? JSObject else { - throw GoogleMapErrors.unhandledError("Bounds northeast property not formatted properly.") - } - - return GMSCoordinateBounds( - coordinate: try getCLLocationCoordinate(southwest), - coordinate: try getCLLocationCoordinate(northeast) - ) - } - - private func getCLLocationCoordinate(_ point: JSObject) throws -> CLLocationCoordinate2D { - guard let lat = point["lat"] as? Double else { - throw GoogleMapErrors.unhandledError("Point lat property not formatted properly.") - } - - guard let lng = point["lng"] as? Double else { - throw GoogleMapErrors.unhandledError("Point lng property not formatted properly.") - } - - return CLLocationCoordinate2D(latitude: lat, longitude: lng) - } - - private func formatMapBoundsForResponse(bounds: GMSCoordinateBounds?, cameraPosition: GMSCameraPosition) -> PluginCallResultData { - return [ - "southwest": [ - "lat": bounds?.southWest.latitude, - "lng": bounds?.southWest.longitude - ], - "center": [ - "lat": cameraPosition.target.latitude, - "lng": cameraPosition.target.longitude - ], - "northeast": [ - "lat": bounds?.northEast.latitude, - "lng": bounds?.northEast.longitude - ] - ] - } - - private func formatMapBoundsForResponse(_ bounds: GMSCoordinateBounds) -> PluginCallResultData { - let centerLatitude = (bounds.southWest.latitude + bounds.northEast.latitude) / 2.0 - let centerLongitude = (bounds.southWest.longitude + bounds.northEast.longitude) / 2.0 - - return [ - "southwest": [ - "lat": bounds.southWest.latitude, - "lng": bounds.southWest.longitude - ], - "center": [ - "lat": centerLatitude, - "lng": centerLongitude - ], - "northeast": [ - "lat": bounds.northEast.latitude, - "lng": bounds.northEast.longitude - ] - ] - } - - private func handleError(_ call: CAPPluginCall, error: Error) { - let errObject = getErrorObject(error) - call.reject(errObject.message, "\(errObject.code)", error, [:]) - } - - private func findMapIdByMapView(_ mapView: GMSMapView) -> String { - for (mapId, map) in self.maps { - if map.mapViewController.GMapView === mapView { - return mapId - } - } - return "" - } - - // --- EVENT LISTENERS --- - - // onCameraIdle - public func mapView(_ mapView: GMSMapView, idleAt cameraPosition: GMSCameraPosition) { - let mapId = self.findMapIdByMapView(mapView) - let map = self.maps[mapId] - let bounds = map?.getMapLatLngBounds() - - let data: PluginCallResultData = [ - "mapId": mapId, - "bounds": formatMapBoundsForResponse( - bounds: bounds, - cameraPosition: cameraPosition - ), - "bearing": cameraPosition.bearing, - "latitude": cameraPosition.target.latitude, - "longitude": cameraPosition.target.longitude, - "tilt": cameraPosition.viewingAngle, - "zoom": cameraPosition.zoom - ] - - self.notifyListeners("onBoundsChanged", data: data) - self.notifyListeners("onCameraIdle", data: data) - } - - // onCameraMoveStarted - public func mapView(_ mapView: GMSMapView, willMove gesture: Bool) { - self.notifyListeners("onCameraMoveStarted", data: [ - "mapId": self.findMapIdByMapView(mapView), - "isGesture": gesture - ]) - } - - // onMapClick - public func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) { - self.notifyListeners("onMapClick", data: [ - "mapId": self.findMapIdByMapView(mapView), - "latitude": coordinate.latitude, - "longitude": coordinate.longitude - ]) - } - - // onPolygonClick, onPolylineClick, onCircleClick - public func mapView(_ mapView: GMSMapView, didTap overlay: GMSOverlay) { - if let polygon = overlay as? GMSPolygon { - self.notifyListeners("onPolygonClick", data: [ - "mapId": self.findMapIdByMapView(mapView), - "polygonId": String(overlay.hash.hashValue), - "tag": polygon.userData as? String - ]) - } - - if let circle = overlay as? GMSCircle { - self.notifyListeners("onCircleClick", data: [ - "mapId": self.findMapIdByMapView(mapView), - "circleId": String(overlay.hash.hashValue), - "tag": circle.userData as? String, - "latitude": circle.position.latitude, - "longitude": circle.position.longitude, - "radius": circle.radius - ]) - } - - if let polyline = overlay as? GMSPolyline { - self.notifyListeners("onPolylineClick", data: [ - "mapId": self.findMapIdByMapView(mapView), - "polylineId": String(overlay.hash.hashValue), - "tag": polyline.userData as? String - ]) - } - } - - // onClusterClick, onMarkerClick - public func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool { - if let cluster = marker.userData as? GMUCluster { - var items: [[String: Any?]] = [] - - for item in cluster.items { - items.append([ - "markerId": String(item.hash.hashValue), - "latitude": item.position.latitude, - "longitude": item.position.longitude, - "title": item.title ?? "", - "snippet": item.snippet ?? "" - ]) - } - - self.notifyListeners("onClusterClick", data: [ - "mapId": self.findMapIdByMapView(mapView), - "latitude": cluster.position.latitude, - "longitude": cluster.position.longitude, - "size": cluster.count, - "items": items - ]) - } else { - self.notifyListeners("onMarkerClick", data: [ - "mapId": self.findMapIdByMapView(mapView), - "markerId": String(marker.hash.hashValue), - "latitude": marker.position.latitude, - "longitude": marker.position.longitude, - "title": marker.title ?? "", - "snippet": marker.snippet ?? "" - ]) - } - return false - } - - // onMarkerDragStart - public func mapView(_ mapView: GMSMapView, didBeginDragging marker: GMSMarker) { - self.notifyListeners("onMarkerDragStart", data: [ - "mapId": self.findMapIdByMapView(mapView), - "markerId": String(marker.hash.hashValue), - "latitude": marker.position.latitude, - "longitude": marker.position.longitude, - "title": marker.title ?? "", - "snippet": marker.snippet ?? "" - ]) - } - - // onMarkerDrag - public func mapView(_ mapView: GMSMapView, didDrag marker: GMSMarker) { - self.notifyListeners("onMarkerDrag", data: [ - "mapId": self.findMapIdByMapView(mapView), - "markerId": String(marker.hash.hashValue), - "latitude": marker.position.latitude, - "longitude": marker.position.longitude, - "title": marker.title ?? "", - "snippet": marker.snippet ?? "" - ]) - } - - // onMarkerDragEnd - public func mapView(_ mapView: GMSMapView, didEndDragging marker: GMSMarker) { - self.notifyListeners("onMarkerDragEnd", data: [ - "mapId": self.findMapIdByMapView(mapView), - "markerId": String(marker.hash.hashValue), - "latitude": marker.position.latitude, - "longitude": marker.position.longitude, - "title": marker.title ?? "", - "snippet": marker.snippet ?? "" - ]) - } - - // onClusterInfoWindowClick, onInfoWindowClick - public func mapView(_ mapView: GMSMapView, didTapInfoWindowOf marker: GMSMarker) { - if let cluster = marker.userData as? GMUCluster { - var items: [[String: Any?]] = [] - - for item in cluster.items { - items.append([ - "markerId": String(item.hash.hashValue), - "latitude": item.position.latitude, - "longitude": item.position.longitude, - "title": item.title ?? "", - "snippet": item.snippet ?? "" - ]) - } - - self.notifyListeners("onClusterInfoWindowClick", data: [ - "mapId": self.findMapIdByMapView(mapView), - "latitude": cluster.position.latitude, - "longitude": cluster.position.longitude, - "size": cluster.count, - "items": items - ]) - } else { - self.notifyListeners("onInfoWindowClick", data: [ - "mapId": self.findMapIdByMapView(mapView), - "markerId": String(marker.hash.hashValue), - "latitude": marker.position.latitude, - "longitude": marker.position.longitude, - "title": marker.title ?? "", - "snippet": marker.snippet ?? "" - ]) - } - } - - // onMyLocationButtonClick - public func didTapMyLocationButtonForMapView(for mapView: GMSMapView) -> Bool { - self.notifyListeners("onMyLocationButtonClick", data: [ - "mapId": self.findMapIdByMapView(mapView) - ]) - return false - } - - // onMyLocationClick - public func mapView(_ mapView: GMSMapView, didTapMyLocation location: CLLocationCoordinate2D) { - self.notifyListeners("onMyLocationButtonClick", data: [ - "mapId": self.findMapIdByMapView(mapView), - "latitude": location.latitude, - "longitude": location.longitude - ]) - } -} - -// snippet from https://www.hackingwithswift.com/example-code/uicolor/how-to-convert-a-hex-color-to-a-uicolor -extension UIColor { - public convenience init?(hex: String) { - let r, g, b, a: CGFloat - - if hex.hasPrefix("#") { - let start = hex.index(hex.startIndex, offsetBy: 1) - let hexColor = String(hex[start...]) - - let scanner = Scanner(string: hexColor) - var hexNumber: UInt64 = 0 - if hexColor.count == 8 { - if scanner.scanHexInt64(&hexNumber) { - r = CGFloat((hexNumber & 0xff000000) >> 24) / 255 - g = CGFloat((hexNumber & 0x00ff0000) >> 16) / 255 - b = CGFloat((hexNumber & 0x0000ff00) >> 8) / 255 - a = CGFloat(hexNumber & 0x000000ff) / 255 - - self.init(red: r, green: g, blue: b, alpha: a) - return - } - } else { - if scanner.scanHexInt64(&hexNumber) { - r = CGFloat((hexNumber & 0xff0000) >> 16) / 255 - g = CGFloat((hexNumber & 0x00ff00) >> 8) / 255 - b = CGFloat((hexNumber & 0x0000ff) >> 0) / 255 - - self.init(red: r, green: g, blue: b, alpha: 1) - return - } - } - } - - return nil - } -} diff --git a/google-maps/ios/Plugin/Circle.swift b/google-maps/ios/Plugin/Circle.swift deleted file mode 100644 index 92dea80f0..000000000 --- a/google-maps/ios/Plugin/Circle.swift +++ /dev/null @@ -1,62 +0,0 @@ -import Foundation -import Capacitor - -public struct Circle { - let center: LatLng - let radius: Double - let strokeWidth: CGFloat - let strokeColor: UIColor - let fillColor: UIColor - let tappable: Bool? - let title: String? - let zIndex: Int32 - let tag: String? - - init(from jsObject: JSObject) throws { - var strokeColor = UIColor.blue - var strokeWidth: CGFloat = 1.0 - var fillColor = UIColor.blue - - guard let centerLatLng = jsObject["center"] as? JSObject else { - throw GoogleMapErrors.invalidArguments("Circle object is missing the required 'center' property") - } - - guard let lat = centerLatLng["lat"] as? Double, let lng = centerLatLng["lng"] as? Double else { - throw GoogleMapErrors.invalidArguments("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - guard let radius = jsObject["radius"] as? Double else { - throw GoogleMapErrors.invalidArguments("Circle object is missing the required 'radius' property") - } - - if let width = jsObject["strokeWeight"] as? Float { - strokeWidth = CGFloat(width) - } - - let strokeOpacity = jsObject["strokeOpacity"] as? Double - - if let hexColor = jsObject["strokeColor"] as? String { - strokeColor = UIColor(hex: hexColor) ?? UIColor.blue - } - - strokeColor = strokeColor.withAlphaComponent(strokeOpacity ?? 1.0) - - let fillOpacity = jsObject["fillOpacity"] as? Double - - if let hexColor = jsObject["fillColor"] as? String { - fillColor = UIColor(hex: hexColor) ?? UIColor.blue - } - - fillColor = fillColor.withAlphaComponent(fillOpacity ?? 1.0) - - self.center = LatLng(lat: lat, lng: lng) - self.radius = radius - self.fillColor = fillColor - self.strokeColor = strokeColor - self.strokeWidth = strokeWidth - self.tag = jsObject["tag"] as? String - self.tappable = jsObject["clickable"] as? Bool - self.title = jsObject["title"] as? String - self.zIndex = Int32((jsObject["zIndex"] as? Int) ?? 0) - } -} diff --git a/google-maps/ios/Plugin/GoogleMapCameraConfig.swift b/google-maps/ios/Plugin/GoogleMapCameraConfig.swift deleted file mode 100644 index fd337758d..000000000 --- a/google-maps/ios/Plugin/GoogleMapCameraConfig.swift +++ /dev/null @@ -1,29 +0,0 @@ -import Foundation -import Capacitor - -public struct GoogleMapCameraConfig { - let coordinate: LatLng? - let zoom: Float? - let bearing: Double? - let angle: Double? - let animate: Bool? - let animationDuration: Double? - - init(fromJSObject: JSObject) throws { - zoom = fromJSObject["zoom"] as? Float - bearing = fromJSObject["bearing"] as? Double - angle = fromJSObject["angle"] as? Double - animate = fromJSObject["animate"] as? Bool - animationDuration = fromJSObject["animationDuration"] as? Double - - if let latLngObj = fromJSObject["coordinate"] as? JSObject { - guard let lat = latLngObj["lat"] as? Double, let lng = latLngObj["lng"] as? Double else { - throw GoogleMapErrors.invalidArguments("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - self.coordinate = LatLng(lat: lat, lng: lng) - } else { - self.coordinate = nil - } - } -} diff --git a/google-maps/ios/Plugin/GoogleMapConfig.swift b/google-maps/ios/Plugin/GoogleMapConfig.swift deleted file mode 100644 index ef97fe77b..000000000 --- a/google-maps/ios/Plugin/GoogleMapConfig.swift +++ /dev/null @@ -1,57 +0,0 @@ -import Foundation -import Capacitor - -public struct GoogleMapConfig: Codable { - let width: Double - let height: Double - let x: Double - let y: Double - let center: LatLng - let zoom: Double - let styles: String? - var mapId: String? - - init(fromJSObject: JSObject) throws { - guard let width = fromJSObject["width"] as? Double else { - throw GoogleMapErrors.invalidArguments("GoogleMapConfig object is missing the required 'width' property") - } - - guard let height = fromJSObject["height"] as? Double else { - throw GoogleMapErrors.invalidArguments("GoogleMapConfig object is missing the required 'height' property") - } - - guard let x = fromJSObject["x"] as? Double else { - throw GoogleMapErrors.invalidArguments("GoogleMapConfig object is missing the required 'x' property") - } - - guard let y = fromJSObject["y"] as? Double else { - throw GoogleMapErrors.invalidArguments("GoogleMapConfig object is missing the required 'y' property") - } - - guard let zoom = fromJSObject["zoom"] as? Double else { - throw GoogleMapErrors.invalidArguments("GoogleMapConfig object is missing the required 'zoom' property") - } - - guard let latLngObj = fromJSObject["center"] as? JSObject else { - throw GoogleMapErrors.invalidArguments("GoogleMapConfig object is missing the required 'center' property") - } - - guard let lat = latLngObj["lat"] as? Double, let lng = latLngObj["lng"] as? Double else { - throw GoogleMapErrors.invalidArguments("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - self.width = round(width) - self.height = round(height) - self.x = x - self.y = y - self.zoom = zoom - self.center = LatLng(lat: lat, lng: lng) - if let stylesArray = fromJSObject["styles"] as? JSArray, let jsonData = try? JSONSerialization.data(withJSONObject: stylesArray, options: []) { - self.styles = String(data: jsonData, encoding: .utf8) - } else { - self.styles = nil - } - - self.mapId = fromJSObject["iOSMapId"] as? String - } -} diff --git a/google-maps/ios/Plugin/GoogleMapErrors.swift b/google-maps/ios/Plugin/GoogleMapErrors.swift deleted file mode 100644 index 07aa7656a..000000000 --- a/google-maps/ios/Plugin/GoogleMapErrors.swift +++ /dev/null @@ -1,47 +0,0 @@ -import Foundation - -public enum GoogleMapErrors: Error { - case invalidMapId - case mapNotFound - case markerNotFound - case invalidArguments(_ description: String) - case invalidAPIKey - case permissionsDeniedLocation - case unhandledError(_ description: String) -} - -public struct GoogleMapErrorObject { - let extra: [String: Any]? - let code: Int - let message: String - init(_ code: Int, _ message: String, _ extra: [String: Any]? = nil) { - self.code = code - self.message = message - self.extra = extra - } - - var asDictionary: [String: Any] { - return ["code": code, "message": message, "extra": extra ?? []] - } -} - -public func getErrorObject(_ error: Error) -> GoogleMapErrorObject { - switch error { - case GoogleMapErrors.invalidMapId: - return GoogleMapErrorObject(1, "Missing or invalid map id.") - case GoogleMapErrors.mapNotFound: - return GoogleMapErrorObject(2, "Map not found for provided id.") - case GoogleMapErrors.markerNotFound: - return GoogleMapErrorObject(3, "Marker not found for provided id.") - case GoogleMapErrors.invalidArguments(let msg): - return GoogleMapErrorObject(4, "Invalid Arguments Provided: \(msg)") - case GoogleMapErrors.permissionsDeniedLocation: - return GoogleMapErrorObject(5, "Permissions denied for accessing device location.") - case GoogleMapErrors.invalidAPIKey: - return GoogleMapErrorObject(6, "Missing or invalid Google Maps SDK API key.") - case GoogleMapErrors.unhandledError(let msg): - return GoogleMapErrorObject(0, "Unhandled Error: \(msg)") - default: - return GoogleMapErrorObject(0, "Unhandled Error: \(error.localizedDescription)") - } -} diff --git a/google-maps/ios/Plugin/GoogleMapPadding.swift b/google-maps/ios/Plugin/GoogleMapPadding.swift deleted file mode 100644 index 15953566f..000000000 --- a/google-maps/ios/Plugin/GoogleMapPadding.swift +++ /dev/null @@ -1,16 +0,0 @@ -import Foundation -import Capacitor - -public struct GoogleMapPadding { - let top: Float - let bottom: Float - let left: Float - let right: Float - - init(fromJSObject: JSObject) throws { - top = fromJSObject["top"] as? Float ?? 0 - bottom = fromJSObject["bottom"] as? Float ?? 0 - left = fromJSObject["left"] as? Float ?? 0 - right = fromJSObject["right"] as? Float ?? 0 - } -} diff --git a/google-maps/ios/Plugin/Info.plist b/google-maps/ios/Plugin/Info.plist deleted file mode 100644 index 1007fd9dd..000000000 --- a/google-maps/ios/Plugin/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/google-maps/ios/Plugin/Map.swift b/google-maps/ios/Plugin/Map.swift deleted file mode 100644 index 71e4a7de9..000000000 --- a/google-maps/ios/Plugin/Map.swift +++ /dev/null @@ -1,734 +0,0 @@ -import Foundation -import GoogleMaps -import Capacitor -import GoogleMapsUtils - -public struct LatLng: Codable { - let lat: Double - let lng: Double -} - -class GMViewController: UIViewController { - var mapViewBounds: [String: Double]! - var GMapView: GMSMapView! - var cameraPosition: [String: Double]! - var minimumClusterSize: Int? - var mapId: String? - - private var clusterManager: GMUClusterManager? - - var clusteringEnabled: Bool { - return clusterManager != nil - } - - override func viewDidLoad() { - super.viewDidLoad() - - let camera = GMSCameraPosition.camera(withLatitude: cameraPosition["latitude"] ?? 0, longitude: cameraPosition["longitude"] ?? 0, zoom: Float(cameraPosition["zoom"] ?? 12)) - let frame = CGRect(x: mapViewBounds["x"] ?? 0, y: mapViewBounds["y"] ?? 0, width: mapViewBounds["width"] ?? 0, height: mapViewBounds["height"] ?? 0) - if let id = mapId { - let gmsId = GMSMapID(identifier: id) - self.GMapView = GMSMapView(frame: frame, mapID: gmsId, camera: camera) - } else { - self.GMapView = GMSMapView(frame: frame, camera: camera) - } - - self.view = GMapView - } - - func initClusterManager(_ minClusterSize: Int?) { - let iconGenerator = GMUDefaultClusterIconGenerator() - let algorithm = GMUNonHierarchicalDistanceBasedAlgorithm() - let renderer = GMUDefaultClusterRenderer(mapView: self.GMapView, clusterIconGenerator: iconGenerator) - self.minimumClusterSize = minClusterSize - if let minClusterSize = minClusterSize { - renderer.minimumClusterSize = UInt(minClusterSize) - } - self.clusterManager = GMUClusterManager(map: self.GMapView, algorithm: algorithm, renderer: renderer) - } - - func destroyClusterManager() { - self.clusterManager = nil - } - - func addMarkersToCluster(markers: [GMSMarker]) { - if let clusterManager = clusterManager { - clusterManager.add(markers) - clusterManager.cluster() - } - } - - func removeMarkersFromCluster(markers: [GMSMarker]) { - if let clusterManager = clusterManager { - markers.forEach { marker in - clusterManager.remove(marker) - } - clusterManager.cluster() - } - } -} - -// swiftlint:disable type_body_length -public class Map { - var id: String - var config: GoogleMapConfig - var mapViewController: GMViewController - var targetViewController: UIView? - var markers = [Int: GMSMarker]() - var polygons = [Int: GMSPolygon]() - var circles = [Int: GMSCircle]() - var polylines = [Int: GMSPolyline]() - var markerIcons = [String: UIImage]() - - // swiftlint:disable identifier_name - public static let MAP_TAG = 99999 - // swiftlint:enable identifier_name - - // swiftlint:disable weak_delegate - private var delegate: CapacitorGoogleMapsPlugin - - init(id: String, config: GoogleMapConfig, delegate: CapacitorGoogleMapsPlugin) { - self.id = id - self.config = config - self.delegate = delegate - self.mapViewController = GMViewController() - self.mapViewController.mapId = config.mapId - - self.render() - } - - func render() { - DispatchQueue.main.async { - self.mapViewController.mapViewBounds = [ - "width": self.config.width, - "height": self.config.height, - "x": self.config.x, - "y": self.config.y - ] - - self.mapViewController.cameraPosition = [ - "latitude": self.config.center.lat, - "longitude": self.config.center.lng, - "zoom": self.config.zoom - ] - - self.targetViewController = self.getTargetContainer(refWidth: self.config.width, refHeight: self.config.height) - - if let target = self.targetViewController { - target.tag = Map.MAP_TAG - target.removeAllSubview() - self.mapViewController.view.frame = target.bounds - target.addSubview(self.mapViewController.view) - self.mapViewController.GMapView.delegate = self.delegate - } - - if let styles = self.config.styles { - do { - self.mapViewController.GMapView.mapStyle = try GMSMapStyle(jsonString: styles) - } catch { - CAPLog.print("Invalid Google Maps styles") - } - } - - self.delegate.notifyListeners("onMapReady", data: [ - "mapId": self.id - ]) - } - } - - func updateRender(mapBounds: CGRect) { - DispatchQueue.main.sync { - let newWidth = round(Double(mapBounds.width)) - let newHeight = round(Double(mapBounds.height)) - let isWidthEqual = round(Double(self.mapViewController.view.bounds.width)) == newWidth - let isHeightEqual = round(Double(self.mapViewController.view.bounds.height)) == newHeight - - if !isWidthEqual || !isHeightEqual { - CATransaction.begin() - CATransaction.setDisableActions(true) - self.mapViewController.view.frame.size.width = newWidth - self.mapViewController.view.frame.size.height = newHeight - CATransaction.commit() - } - } - } - - func rebindTargetContainer(mapBounds: CGRect) { - DispatchQueue.main.sync { - if let target = self.getTargetContainer(refWidth: round(Double(mapBounds.width)), refHeight: round(Double(mapBounds.height))) { - self.targetViewController = target - target.tag = Map.MAP_TAG - target.removeAllSubview() - CATransaction.begin() - CATransaction.setDisableActions(true) - self.mapViewController.view.frame.size.width = mapBounds.width - self.mapViewController.view.frame.size.height = mapBounds.height - CATransaction.commit() - target.addSubview(self.mapViewController.view) - } - } - } - - private func getTargetContainer(refWidth: Double, refHeight: Double) -> UIView? { - if let bridge = self.delegate.bridge { - for item in bridge.webView!.getAllSubViews() { - let isScrollView = item.isKind(of: NSClassFromString("WKChildScrollView")!) || item.isKind(of: NSClassFromString("WKScrollView")!) - let isBridgeScrollView = item.isEqual(bridge.webView?.scrollView) - - if isScrollView && !isBridgeScrollView { - (item as? UIScrollView)?.isScrollEnabled = true - - let height = Double((item as? UIScrollView)?.contentSize.height ?? 0) - let width = Double((item as? UIScrollView)?.contentSize.width ?? 0) - let actualHeight = round(height / 2) - - let isWidthEqual = width == self.config.width - let isHeightEqual = actualHeight == self.config.height - - if isWidthEqual && isHeightEqual && item.tag < self.targetViewController?.tag ?? Map.MAP_TAG { - return item - } - } - } - } - - return nil - } - - func destroy() { - DispatchQueue.main.async { - self.mapViewController.GMapView = nil - self.targetViewController?.tag = 0 - self.mapViewController.view = nil - self.enableTouch() - } - } - - func enableTouch() { - DispatchQueue.main.async { - if let target = self.targetViewController, let itemIndex = WKWebView.disabledTargets.firstIndex(of: target) { - WKWebView.disabledTargets.remove(at: itemIndex) - } - } - } - - func disableTouch() { - DispatchQueue.main.async { - if let target = self.targetViewController, !WKWebView.disabledTargets.contains(target) { - WKWebView.disabledTargets.append(target) - } - } - } - - func addMarker(marker: Marker) throws -> Int { - var markerHash = 0 - - DispatchQueue.main.sync { - let newMarker = self.buildMarker(marker: marker) - - if self.mapViewController.clusteringEnabled { - self.mapViewController.addMarkersToCluster(markers: [newMarker]) - } else { - newMarker.map = self.mapViewController.GMapView - } - - self.markers[newMarker.hash.hashValue] = newMarker - - markerHash = newMarker.hash.hashValue - } - - return markerHash - } - - func addMarkers(markers: [Marker]) throws -> [Int] { - var markerHashes: [Int] = [] - - DispatchQueue.main.sync { - var googleMapsMarkers: [GMSMarker] = [] - - markers.forEach { marker in - let newMarker = self.buildMarker(marker: marker) - - if self.mapViewController.clusteringEnabled { - googleMapsMarkers.append(newMarker) - } else { - newMarker.map = self.mapViewController.GMapView - } - - self.markers[newMarker.hash.hashValue] = newMarker - - markerHashes.append(newMarker.hash.hashValue) - } - - if self.mapViewController.clusteringEnabled { - self.mapViewController.addMarkersToCluster(markers: googleMapsMarkers) - } - } - - return markerHashes - } - - func addPolygons(polygons: [Polygon]) throws -> [Int] { - var polygonHashes: [Int] = [] - - DispatchQueue.main.sync { - polygons.forEach { polygon in - let newPolygon = self.buildPolygon(polygon: polygon) - newPolygon.map = self.mapViewController.GMapView - - self.polygons[newPolygon.hash.hashValue] = newPolygon - - polygonHashes.append(newPolygon.hash.hashValue) - } - } - - return polygonHashes - } - - func addCircles(circles: [Circle]) throws -> [Int] { - var circleHashes: [Int] = [] - - DispatchQueue.main.sync { - circles.forEach { circle in - let newCircle = self.buildCircle(circle: circle) - newCircle.map = self.mapViewController.GMapView - - self.circles[newCircle.hash.hashValue] = newCircle - - circleHashes.append(newCircle.hash.hashValue) - } - } - - return circleHashes - } - - func addPolylines(lines: [Polyline]) throws -> [Int] { - var polylineHashes: [Int] = [] - - DispatchQueue.main.sync { - lines.forEach { line in - let newLine = self.buildPolyline(line: line) - newLine.map = self.mapViewController.GMapView - - self.polylines[newLine.hash.hashValue] = newLine - - polylineHashes.append(newLine.hash.hashValue) - } - } - - return polylineHashes - } - - func enableClustering(_ minClusterSize: Int?) { - if !self.mapViewController.clusteringEnabled { - DispatchQueue.main.sync { - self.mapViewController.initClusterManager(minClusterSize) - - // add existing markers to the cluster - if !self.markers.isEmpty { - var existingMarkers: [GMSMarker] = [] - for (_, marker) in self.markers { - marker.map = nil - existingMarkers.append(marker) - } - - self.mapViewController.addMarkersToCluster(markers: existingMarkers) - } - } - } else if self.mapViewController.minimumClusterSize != minClusterSize { - self.mapViewController.destroyClusterManager() - enableClustering(minClusterSize) - } - } - - func disableClustering() { - DispatchQueue.main.sync { - self.mapViewController.destroyClusterManager() - - // add existing markers back to the map - if !self.markers.isEmpty { - for (_, marker) in self.markers { - marker.map = self.mapViewController.GMapView - } - } - } - } - - func removeMarker(id: Int) throws { - if let marker = self.markers[id] { - DispatchQueue.main.async { - if self.mapViewController.clusteringEnabled { - self.mapViewController.removeMarkersFromCluster(markers: [marker]) - } - - marker.map = nil - self.markers.removeValue(forKey: id) - - } - } else { - throw GoogleMapErrors.markerNotFound - } - } - - func removePolygons(ids: [Int]) throws { - DispatchQueue.main.sync { - ids.forEach { id in - if let polygon = self.polygons[id] { - polygon.map = nil - self.polygons.removeValue(forKey: id) - } - } - } - } - - func removeCircles(ids: [Int]) throws { - DispatchQueue.main.sync { - ids.forEach { id in - if let circle = self.circles[id] { - circle.map = nil - self.circles.removeValue(forKey: id) - } - } - } - } - - func removePolylines(ids: [Int]) throws { - DispatchQueue.main.sync { - ids.forEach { id in - if let line = self.polylines[id] { - line.map = nil - self.polylines.removeValue(forKey: id) - } - } - } - } - - func setCamera(config: GoogleMapCameraConfig) throws { - let currentCamera = self.mapViewController.GMapView.camera - - let lat = config.coordinate?.lat ?? currentCamera.target.latitude - let lng = config.coordinate?.lng ?? currentCamera.target.longitude - - let zoom = config.zoom ?? currentCamera.zoom - let bearing = config.bearing ?? Double(currentCamera.bearing) - let angle = config.angle ?? currentCamera.viewingAngle - - let animate = config.animate ?? false - - DispatchQueue.main.sync { - let newCamera = GMSCameraPosition(latitude: lat, longitude: lng, zoom: zoom, bearing: bearing, viewingAngle: angle) - - if animate { - self.mapViewController.GMapView.animate(to: newCamera) - } else { - self.mapViewController.GMapView.camera = newCamera - } - } - - } - - func getMapType() -> GMSMapViewType { - return self.mapViewController.GMapView.mapType - } - - func setMapType(mapType: GMSMapViewType) throws { - DispatchQueue.main.sync { - self.mapViewController.GMapView.mapType = mapType - } - } - - func enableIndoorMaps(enabled: Bool) throws { - DispatchQueue.main.sync { - self.mapViewController.GMapView.isIndoorEnabled = enabled - } - } - - func enableTrafficLayer(enabled: Bool) throws { - DispatchQueue.main.sync { - self.mapViewController.GMapView.isTrafficEnabled = enabled - } - } - - func enableAccessibilityElements(enabled: Bool) throws { - DispatchQueue.main.sync { - self.mapViewController.GMapView.accessibilityElementsHidden = enabled - } - } - - func enableCurrentLocation(enabled: Bool) throws { - DispatchQueue.main.sync { - self.mapViewController.GMapView.isMyLocationEnabled = enabled - } - } - - func setPadding(padding: GoogleMapPadding) throws { - DispatchQueue.main.sync { - let mapInsets = UIEdgeInsets(top: CGFloat(padding.top), left: CGFloat(padding.left), bottom: CGFloat(padding.bottom), right: CGFloat(padding.right)) - self.mapViewController.GMapView.padding = mapInsets - } - } - - func removeMarkers(ids: [Int]) throws { - DispatchQueue.main.sync { - var markers: [GMSMarker] = [] - ids.forEach { id in - if let marker = self.markers[id] { - marker.map = nil - self.markers.removeValue(forKey: id) - markers.append(marker) - } - } - - if self.mapViewController.clusteringEnabled { - self.mapViewController.removeMarkersFromCluster(markers: markers) - } - } - } - - func getMapLatLngBounds() -> GMSCoordinateBounds? { - return GMSCoordinateBounds(region: self.mapViewController.GMapView.projection.visibleRegion()) - } - - func fitBounds(bounds: GMSCoordinateBounds, padding: CGFloat) { - DispatchQueue.main.sync { - let cameraUpdate = GMSCameraUpdate.fit(bounds, withPadding: padding) - self.mapViewController.GMapView.animate(with: cameraUpdate) - } - } - - private func getFrameOverflowBounds(frame: CGRect, mapBounds: CGRect) -> [CGRect] { - var intersections: [CGRect] = [] - - // get top overflow - if mapBounds.origin.y < frame.origin.y { - let height = frame.origin.y - mapBounds.origin.y - let width = mapBounds.width - intersections.append(CGRect(x: 0, y: 0, width: width, height: height)) - } - - // get bottom overflow - if (mapBounds.origin.y + mapBounds.height) > (frame.origin.y + frame.height) { - let height = (mapBounds.origin.y + mapBounds.height) - (frame.origin.y + frame.height) - let width = mapBounds.width - intersections.append(CGRect(x: 0, y: mapBounds.height, width: width, height: height)) - } - - return intersections - } - - private func buildCircle(circle: Circle) -> GMSCircle { - let newCircle = GMSCircle() - newCircle.title = circle.title - newCircle.strokeColor = circle.strokeColor - newCircle.strokeWidth = circle.strokeWidth - newCircle.fillColor = circle.fillColor - newCircle.position = CLLocationCoordinate2D(latitude: circle.center.lat, longitude: circle.center.lng) - newCircle.radius = CLLocationDistance(circle.radius) - newCircle.isTappable = circle.tappable ?? false - newCircle.zIndex = circle.zIndex - newCircle.userData = circle.tag - - return newCircle - } - - private func buildPolygon(polygon: Polygon) -> GMSPolygon { - let newPolygon = GMSPolygon() - newPolygon.title = polygon.title - newPolygon.strokeColor = polygon.strokeColor - newPolygon.strokeWidth = polygon.strokeWidth - newPolygon.fillColor = polygon.fillColor - newPolygon.isTappable = polygon.tappable ?? false - newPolygon.geodesic = polygon.geodesic ?? false - newPolygon.zIndex = polygon.zIndex - newPolygon.userData = polygon.tag - - var shapeIndex = 0 - let outerShape = GMSMutablePath() - var holes: [GMSMutablePath] = [] - - polygon.shapes.forEach { shape in - if shapeIndex == 0 { - shape.forEach { coord in - outerShape.add(CLLocationCoordinate2D(latitude: coord.lat, longitude: coord.lng)) - } - } else { - let holeShape = GMSMutablePath() - shape.forEach { coord in - holeShape.add(CLLocationCoordinate2D(latitude: coord.lat, longitude: coord.lng)) - } - - holes.append(holeShape) - } - - shapeIndex += 1 - } - - newPolygon.path = outerShape - newPolygon.holes = holes - - return newPolygon - } - - private func buildPolyline(line: Polyline) -> GMSPolyline { - let newPolyline = GMSPolyline() - newPolyline.title = line.title - newPolyline.strokeColor = line.strokeColor - newPolyline.strokeWidth = line.strokeWidth - newPolyline.isTappable = line.tappable ?? false - newPolyline.geodesic = line.geodesic ?? false - newPolyline.zIndex = line.zIndex - newPolyline.userData = line.tag - - let path = GMSMutablePath() - line.path.forEach { coord in - path.add(CLLocationCoordinate2D(latitude: coord.lat, longitude: coord.lng)) - } - - newPolyline.path = path - - if line.styleSpans.count > 0 { - var spans: [GMSStyleSpan] = [] - - line.styleSpans.forEach { span in - if let segments = span.segments { - spans.append(GMSStyleSpan(color: span.color, segments: segments)) - } else { - spans.append(GMSStyleSpan(color: span.color)) - } - } - - newPolyline.spans = spans - } - - return newPolyline - } - - private func buildMarker(marker: Marker) -> GMSMarker { - let newMarker = GMSMarker() - newMarker.position = CLLocationCoordinate2D(latitude: marker.coordinate.lat, longitude: marker.coordinate.lng) - newMarker.title = marker.title - newMarker.snippet = marker.snippet - newMarker.isFlat = marker.isFlat ?? false - newMarker.opacity = marker.opacity ?? 1 - newMarker.isDraggable = marker.draggable ?? false - newMarker.zIndex = marker.zIndex - if let iconAnchor = marker.iconAnchor { - newMarker.groundAnchor = iconAnchor - } - - // cache and reuse marker icon uiimages - if let iconUrl = marker.iconUrl { - if let iconImage = self.markerIcons[iconUrl] { - newMarker.icon = getResizedIcon(iconImage, marker) - } else { - if iconUrl.starts(with: "https:") { - if let url = URL(string: iconUrl) { - URLSession.shared.dataTask(with: url) { (data, _, _) in - DispatchQueue.main.async { - if let data = data, let iconImage = UIImage(data: data) { - self.markerIcons[iconUrl] = iconImage - newMarker.icon = getResizedIcon(iconImage, marker) - } - } - }.resume() - } - } else if let iconImage = UIImage(named: "public/\(iconUrl)") { - self.markerIcons[iconUrl] = iconImage - newMarker.icon = getResizedIcon(iconImage, marker) - } else { - var detailedMessage = "" - - if iconUrl.hasSuffix(".svg") { - detailedMessage = "SVG not supported." - } - - print("CapacitorGoogleMaps Warning: could not load image '\(iconUrl)'. \(detailedMessage) Using default marker icon.") - } - } - } else { - if let color = marker.color { - newMarker.icon = GMSMarker.markerImage(with: color) - } - } - - return newMarker - } -} - -private func getResizedIcon(_ iconImage: UIImage, _ marker: Marker) -> UIImage? { - if let iconSize = marker.iconSize { - return iconImage.resizeImageTo(size: iconSize) - } else { - return iconImage - } -} - -extension WKWebView { - static var disabledTargets: [UIView] = [] - - override open func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { - var hitView = super.hitTest(point, with: event) - - if let tempHitView = hitView, WKWebView.disabledTargets.contains(tempHitView) { - return nil - } - - if let typeClass = NSClassFromString("WKChildScrollView"), let tempHitView = hitView, tempHitView.isKind(of: typeClass) { - for item in tempHitView.subviews.reversed() { - let convertPoint = item.convert(point, from: self) - if let hitTestView = item.hitTest(convertPoint, with: event) { - hitView = hitTestView - break - } - } - } - - return hitView - } -} - -extension UIView { - private static var allSubviews: [UIView] = [] - - private func viewArray(root: UIView) -> [UIView] { - var index = root.tag - for view in root.subviews { - if view.tag == Map.MAP_TAG { - // view already in use as in map - continue - } - - // tag the index depth of the uiview - view.tag = index - - if view.isKind(of: UIView.self) { - UIView.allSubviews.append(view) - } - _ = viewArray(root: view) - - index += 1 - } - return UIView.allSubviews - } - - fileprivate func getAllSubViews() -> [UIView] { - UIView.allSubviews = [] - return viewArray(root: self).reversed() - } - - fileprivate func removeAllSubview() { - subviews.forEach { - $0.removeFromSuperview() - } - } -} - -extension UIImage { - func resizeImageTo(size: CGSize) -> UIImage? { - UIGraphicsBeginImageContextWithOptions(size, false, 0.0) - self.draw(in: CGRect(origin: CGPoint.zero, size: size)) - let resizedImage = UIGraphicsGetImageFromCurrentImageContext()! - UIGraphicsEndImageContext() - return resizedImage - } -} diff --git a/google-maps/ios/Plugin/Marker.swift b/google-maps/ios/Plugin/Marker.swift deleted file mode 100644 index 135b3c52c..000000000 --- a/google-maps/ios/Plugin/Marker.swift +++ /dev/null @@ -1,80 +0,0 @@ -import Foundation -import Capacitor - -public struct Marker { - let coordinate: LatLng - let opacity: Float? - let title: String? - let snippet: String? - let isFlat: Bool? - let iconUrl: String? - let iconSize: CGSize? - let iconAnchor: CGPoint? - let draggable: Bool? - let color: UIColor? - let zIndex: Int32 - - init(fromJSObject: JSObject) throws { - guard let latLngObj = fromJSObject["coordinate"] as? JSObject else { - throw GoogleMapErrors.invalidArguments("Marker object is missing the required 'coordinate' property") - } - - guard let lat = latLngObj["lat"] as? Double, let lng = latLngObj["lng"] as? Double else { - throw GoogleMapErrors.invalidArguments("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - var iconSize: CGSize? - if let sizeObj = fromJSObject["iconSize"] as? JSObject { - if let width = sizeObj["width"] as? Double, let height = sizeObj["height"] as? Double { - iconSize = CGSize(width: width, height: height) - } - } - - var iconAnchor: CGPoint? - if let anchorObject = fromJSObject["iconAnchor"] as? JSObject { - if let x = anchorObject["x"] as? Double, let y = anchorObject["y"] as? Double { - if let size = iconSize { - let u = x / size.width - let v = y / size.height - - iconAnchor = CGPoint(x: u, y: v) - } - } - } - - var tintColor: UIColor? - if let rgbObject = fromJSObject["tintColor"] as? JSObject { - if let r = rgbObject["r"] as? Double, let g = rgbObject["g"] as? Double, let b = rgbObject["b"] as? Double, let a = rgbObject["a"] as? Double { - - let uiColorR = CGFloat(r / 255).clamp(min: 0, max: 255) - let uiColorG = CGFloat(g / 255).clamp(min: 0, max: 255) - let uiColorB = CGFloat(b / 255).clamp(min: 0, max: 255) - tintColor = UIColor(red: uiColorR, green: uiColorG, blue: uiColorB, alpha: CGFloat(a)) - } - } - - self.coordinate = LatLng(lat: lat, lng: lng) - self.opacity = fromJSObject["opacity"] as? Float - self.title = fromJSObject["title"] as? String - self.snippet = fromJSObject["snippet"] as? String - self.isFlat = fromJSObject["isFlat"] as? Bool - self.iconUrl = fromJSObject["iconUrl"] as? String - self.draggable = fromJSObject["draggable"] as? Bool - self.iconSize = iconSize - self.iconAnchor = iconAnchor - self.color = tintColor - self.zIndex = Int32((fromJSObject["zIndex"] as? Int) ?? 0) - } -} - -extension CGFloat { - func clamp(min: CGFloat, max: CGFloat) -> CGFloat { - if self < min { - return min - } - if self > max { - return max - } - return self - } -} diff --git a/google-maps/ios/Plugin/Polygon.swift b/google-maps/ios/Plugin/Polygon.swift deleted file mode 100644 index 7253ca4b9..000000000 --- a/google-maps/ios/Plugin/Polygon.swift +++ /dev/null @@ -1,84 +0,0 @@ -import Foundation -import Capacitor - -public struct Polygon { - let shapes: [[LatLng]] - let strokeWidth: CGFloat - let strokeColor: UIColor - let fillColor: UIColor - let tappable: Bool? - let geodesic: Bool? - let title: String? - let zIndex: Int32 - let tag: String? - - init(fromJSObject: JSObject) throws { - var strokeColor = UIColor.blue - var strokeWidth: CGFloat = 1.0 - var fillColor = UIColor.blue - var processedShapes: [[LatLng]] = [] - - if let width = fromJSObject["strokeWeight"] as? Float { - strokeWidth = CGFloat(width) - } - - let strokeOpacity = fromJSObject["strokeOpacity"] as? Double - - if let hexColor = fromJSObject["strokeColor"] as? String { - strokeColor = UIColor(hex: hexColor) ?? UIColor.blue - } - - strokeColor = strokeColor.withAlphaComponent(strokeOpacity ?? 1.0) - - let fillOpacity = fromJSObject["fillOpacity"] as? Double - - if let hexColor = fromJSObject["fillColor"] as? String { - fillColor = UIColor(hex: hexColor) ?? UIColor.blue - } - - fillColor = fillColor.withAlphaComponent(fillOpacity ?? 1.0) - - guard let shapeJSArray = fromJSObject["paths"] as? JSArray else { - throw GoogleMapErrors.invalidArguments("Polygon object is missing the required 'paths' property") - } - - if let obj = shapeJSArray.first, obj as? JSArray != nil { - try shapeJSArray.forEach({ obj in - if let shapeArr = obj as? JSArray { - try processedShapes.append(Polygon.processShape(shapeArr)) - } - }) - } else { - // is a single shape - try processedShapes.append(Polygon.processShape(shapeJSArray)) - } - - self.shapes = processedShapes - self.fillColor = fillColor - self.strokeColor = strokeColor - self.strokeWidth = strokeWidth - self.tag = fromJSObject["tag"] as? String - self.tappable = fromJSObject["clickable"] as? Bool - self.title = fromJSObject["title"] as? String - self.geodesic = fromJSObject["geodesic"] as? Bool - self.zIndex = Int32((fromJSObject["zIndex"] as? Int) ?? 0) - } - - private static func processShape(_ shapeArr: JSArray) throws -> [LatLng] { - var shape: [LatLng] = [] - - try shapeArr.forEach { obj in - guard let jsCoord = obj as? JSObject else { - throw GoogleMapErrors.invalidArguments("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - guard let lat = jsCoord["lat"] as? Double, let lng = jsCoord["lng"] as? Double else { - throw GoogleMapErrors.invalidArguments("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - shape.append(LatLng(lat: lat, lng: lng)) - } - - return shape - } -} diff --git a/google-maps/ios/Plugin/Polyline.swift b/google-maps/ios/Plugin/Polyline.swift deleted file mode 100644 index 474fdd419..000000000 --- a/google-maps/ios/Plugin/Polyline.swift +++ /dev/null @@ -1,75 +0,0 @@ -import Foundation -import Capacitor - -public struct StyleSpan { - let color: UIColor - let segments: Double? -} - -public struct Polyline { - let path: [LatLng] - let strokeWidth: CGFloat - let strokeColor: UIColor - let title: String? - let tappable: Bool? - let geodesic: Bool? - let zIndex: Int32 - let tag: String? - let styleSpans: [StyleSpan] - - init(fromJSObject: JSObject) throws { - var strokeColor = UIColor.blue - var strokeWidth: CGFloat = 1.0 - var path: [LatLng] = [] - var styleSpans: [StyleSpan] = [] - - if let width = fromJSObject["strokeWeight"] as? Float { - strokeWidth = CGFloat(width) - } - - let strokeOpacity = fromJSObject["strokeOpacity"] as? Double - - if let hexColor = fromJSObject["strokeColor"] as? String { - strokeColor = UIColor(hex: hexColor) ?? UIColor.blue - } - - strokeColor = strokeColor.withAlphaComponent(strokeOpacity ?? 1.0) - - guard let pathJSArray = fromJSObject["path"] as? JSArray else { - throw GoogleMapErrors.invalidArguments("Polyline object is missing the required 'path' property") - } - - try pathJSArray.forEach { obj in - guard let jsCoord = obj as? JSObject else { - throw GoogleMapErrors.invalidArguments("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - guard let lat = jsCoord["lat"] as? Double, let lng = jsCoord["lng"] as? Double else { - throw GoogleMapErrors.invalidArguments("LatLng object is missing the required 'lat' and/or 'lng' property") - } - - path.append(LatLng(lat: lat, lng: lng)) - } - - if let styleSpanJSArray = fromJSObject["styleSpans"] as? JSArray { - styleSpanJSArray.forEach({ obj in - if let styleSpanObj = obj as? JSObject, - let hexColor = styleSpanObj["color"] as? String, - let color = UIColor(hex: hexColor) { - let segments = styleSpanObj["segments"] as? Double - styleSpans.append(StyleSpan(color: color, segments: segments)) - } - }) - } - - self.strokeColor = strokeColor - self.strokeWidth = strokeWidth - self.tag = fromJSObject["tag"] as? String - self.title = fromJSObject["title"] as? String - self.tappable = fromJSObject["clickable"] as? Bool - self.geodesic = fromJSObject["geodesic"] as? Bool - self.zIndex = Int32((fromJSObject["zIndex"] as? Int) ?? 0) - self.path = path - self.styleSpans = styleSpans - } -} diff --git a/google-maps/ios/PluginTests/CapacitorGoogleMapsTests.swift b/google-maps/ios/PluginTests/CapacitorGoogleMapsTests.swift deleted file mode 100644 index c4643e5d7..000000000 --- a/google-maps/ios/PluginTests/CapacitorGoogleMapsTests.swift +++ /dev/null @@ -1,25 +0,0 @@ -import XCTest -@testable import Plugin - -class CapacitorGoogleMapsTests: XCTestCase { - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testEcho() { - // This is an example of a functional test case for a plugin. - // Use XCTAssert and related functions to verify your tests produce the correct results. - - let implementation = CapacitorGoogleMaps() - let value = "Hello, World!" - let result = implementation.echo(value) - - XCTAssertEqual(value, result) - } -} diff --git a/google-maps/ios/PluginTests/Info.plist b/google-maps/ios/PluginTests/Info.plist deleted file mode 100644 index 6c40a6cd0..000000000 --- a/google-maps/ios/PluginTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/google-maps/ios/Podfile b/google-maps/ios/Podfile deleted file mode 100644 index 8ae77e95d..000000000 --- a/google-maps/ios/Podfile +++ /dev/null @@ -1,20 +0,0 @@ -platform :ios, '13.0' - -def capacitor_pods - # Comment the next line if you're not using Swift and don't want to use dynamic frameworks - use_frameworks! - pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' - pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' -end - -target 'Plugin' do - capacitor_pods - pod 'GoogleMaps', '~> 7.4' - pod 'Google-Maps-iOS-Utils', '~> 4.2' -end - -target 'PluginTests' do - capacitor_pods - pod 'GoogleMaps', '~> 7.4' - pod 'Google-Maps-iOS-Utils', '~> 4.2' -end diff --git a/google-maps/package.json b/google-maps/package.json deleted file mode 100644 index 91ffeef32..000000000 --- a/google-maps/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "name": "@capacitor/google-maps", - "version": "6.0.0-rc.0", - "description": "Google maps on Capacitor", - "main": "dist/plugin.cjs.js", - "module": "dist/esm/index.js", - "typings": "dist/typings/index.d.ts", - "typesVersions": { - "<4.1": { - "dist/typings/index.d.ts": [ - "dist/typings/ts_old/index.d.ts" - ] - } - }, - "unpkg": "dist/plugin.js", - "files": [ - "android/src/main/", - "android/build.gradle", - "dist/", - "ios/Plugin/", - "CapacitorGoogleMaps.podspec" - ], - "author": "Ionic ", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/ionic-team/capacitor-plugins.git" - }, - "bugs": { - "url": "https://github.com/ionic-team/capacitor-plugins/issues" - }, - "keywords": [ - "capacitor", - "plugin", - "native" - ], - "scripts": { - "verify": "npm run verify:ios && npm run verify:android && npm run verify:web", - "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -sdk iphonesimulator && cd ..", - "verify:android": "cd android && ./gradlew clean build test && cd ..", - "verify:web": "npm run build", - "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint", - "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format", - "eslint": "eslint . --ext ts", - "prettier": "prettier \"**/*.{css,html,ts,js,java}\"", - "swiftlint": "node-swiftlint", - "docgen": "docgen --api GoogleMapInterface --output-readme README.md --output-json dist/docs.json", - "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js && npm run downlevel-dts", - "clean": "rimraf ./dist", - "watch": "tsc --watch", - "prepublishOnly": "npm run build", - "publish:cocoapod": "pod trunk push ./CapacitorGoogleMaps.podspec --allow-warnings", - "downlevel-dts": "npx downlevel-dts dist/typings dist/typings/ts_old --to=3.5", - "pack-local": "npm run build && npm pack && find . -name 'capacitor-google-maps-*tgz' -exec bash -c 'mv $0 capacitor-google-maps.tgz' {} \\; ", - "unittest:ios": "xcodebuild test -project ./unit-tests/ios/GoogleMapsPlugin/GoogleMapsPlugin.xcodeproj -scheme TestApp -destination 'platform=iOS Simulator,name=iPhone 12,OS=15.2' | xcpretty && exit ${PIPESTATUS[0]}", - "unittest:android": "cd ./unit-tests/android && ./gradlew testDebugUnitTest" - }, - "devDependencies": { - "@capacitor/android": "next", - "@capacitor/core": "next", - "@capacitor/docgen": "0.2.2", - "@capacitor/ios": "next", - "@ionic/eslint-config": "^0.3.0", - "@ionic/prettier-config": "^1.0.1", - "@types/resize-observer-browser": "^0.1.7", - "@types/supercluster": "^7.1.0", - "downlevel-dts": "^0.7.0", - "eslint": "^7.11.0", - "eslint-plugin-import": "^2.25.4", - "prettier": "~2.3.0", - "prettier-plugin-java": "~1.0.2", - "rimraf": "^3.0.2", - "rollup": "^2.32.0", - "swiftlint": "^1.0.1", - "typescript": "~4.1.5" - }, - "peerDependencies": { - "@capacitor/core": "next" - }, - "prettier": "@ionic/prettier-config", - "eslintConfig": { - "extends": "@ionic/eslint-config/recommended" - }, - "capacitor": { - "ios": { - "src": "ios" - }, - "android": { - "src": "android" - } - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@googlemaps/js-api-loader": "~1.13.7", - "@googlemaps/markerclusterer": "~2.0.7", - "@types/google.maps": "~3.50.5" - } -} diff --git a/google-maps/rollup.config.js b/google-maps/rollup.config.js deleted file mode 100644 index 07b8e87a1..000000000 --- a/google-maps/rollup.config.js +++ /dev/null @@ -1,26 +0,0 @@ -export default { - input: 'dist/esm/index.js', - output: [ - { - file: 'dist/plugin.js', - format: 'iife', - name: 'capacitorCapacitorGoogleMaps', - globals: { - '@capacitor/core': 'capacitorExports', - }, - sourcemap: true, - inlineDynamicImports: true, - }, - { - file: 'dist/plugin.cjs.js', - format: 'cjs', - sourcemap: true, - inlineDynamicImports: true, - }, - ], - external: [ - '@capacitor/core', - '@googlemaps/js-api-loader', - '@googlemaps/markerclusterer', - ], -}; diff --git a/google-maps/src/definitions.ts b/google-maps/src/definitions.ts deleted file mode 100644 index 6fa91254a..000000000 --- a/google-maps/src/definitions.ts +++ /dev/null @@ -1,463 +0,0 @@ -import { CapacitorGoogleMaps } from './implementation'; - -/** - * An interface representing the viewports latitude and longitude bounds. - */ -export interface LatLngBoundsInterface { - southwest: LatLng; - center: LatLng; - northeast: LatLng; -} - -export class LatLngBounds { - southwest: LatLng; - center: LatLng; - northeast: LatLng; - - constructor(bounds: LatLngBoundsInterface) { - this.southwest = bounds.southwest; - this.center = bounds.center; - this.northeast = bounds.northeast; - } - - async contains(point: LatLng): Promise { - const result = await CapacitorGoogleMaps.mapBoundsContains({ - bounds: this, - point, - }); - return result['contains']; - } - - async extend(point: LatLng): Promise { - const result = await CapacitorGoogleMaps.mapBoundsExtend({ - bounds: this, - point, - }); - this.southwest = result['bounds']['southwest']; - this.center = result['bounds']['center']; - this.northeast = result['bounds']['northeast']; - return this; - } -} - -/** - * An interface representing a pair of latitude and longitude coordinates. - */ -export interface LatLng { - /** - * Coordinate latitude, in degrees. This value is in the range [-90, 90]. - */ - lat: number; - - /** - * Coordinate longitude, in degrees. This value is in the range [-180, 180]. - */ - lng: number; -} - -export interface Size { - width: number; - height: number; -} - -export interface Point { - x: number; - y: number; -} - -/** - * For web, all the javascript Polygon options are available as - * Polygon extends google.maps.PolygonOptions. - * For iOS and Android only the config options declared on Polygon are available. - */ -export interface Polygon extends google.maps.PolygonOptions { - strokeColor?: string; - strokeOpacity?: number; - strokeWeight?: number; - fillColor?: string; - fillOpacity?: number; - geodesic?: boolean; - clickable?: boolean; - /** - * Title, a short description of the overlay. Some overlays, such as markers, will display the title on the map. The title is also the default accessibility text. - * - * Only available on iOS. - */ - title?: string; - tag?: string; -} - -/** - * For web, all the javascript Circle options are available as - * Polygon extends google.maps.CircleOptions. - * For iOS and Android only the config options declared on Circle are available. - */ -export interface Circle extends google.maps.CircleOptions { - fillColor?: string; - fillOpacity?: number; - strokeColor?: string; - strokeWeight?: number; - geodesic?: boolean; - clickable?: boolean; - /** - * Title, a short description of the overlay. Some overlays, such as markers, will display the title on the map. The title is also the default accessibility text. - * - * Only available on iOS. - */ - title?: string; - tag?: string; -} - -/** - * For web, all the javascript Polyline options are available as - * Polyline extends google.maps.PolylineOptions. - * For iOS and Android only the config options declared on Polyline are available. - */ -export interface Polyline extends google.maps.PolylineOptions { - strokeColor?: string; - strokeOpacity?: number; - strokeWeight?: number; - geodesic?: boolean; - clickable?: boolean; - tag?: string; - /** - * Used to specify the color of one or more segments of a polyline. The styleSpans property is an array of StyleSpan objects. - * Setting the spans property is the preferred way to change the color of a polyline. - * - * Only on iOS and Android. - */ - styleSpans?: StyleSpan[]; -} - -/** - * Describes the style for some region of a polyline. - */ -export interface StyleSpan { - /** - * The stroke color. All CSS3 colors are supported except for extended named colors. - */ - color: string; - /** - * The length of this span in number of segments. - */ - segments?: number; -} - -/** - * For web, all the javascript Google Maps options are available as - * GoogleMapConfig extends google.maps.MapOptions. - * For iOS and Android only the config options declared on GoogleMapConfig are available. - */ -export interface GoogleMapConfig extends google.maps.MapOptions { - /** - * Override width for native map. - */ - width?: number; - /** - * Override height for native map. - */ - height?: number; - /** - * Override absolute x coordinate position for native map. - */ - x?: number; - /** - * Override absolute y coordinate position for native map. - */ - y?: number; - /** - * Default location on the Earth towards which the camera points. - */ - center: LatLng; - /** - * Sets the zoom of the map. - */ - zoom: number; - /** - * Enables image-based lite mode on Android. - * - * @default false - */ - androidLiteMode?: boolean; - /** - * Override pixel ratio for native map. - */ - devicePixelRatio?: number; - /** - * Styles to apply to each of the default map types. Note that for - * satellite, hybrid and terrain modes, - * these styles will only apply to labels and geometry. - * - * @since 4.3.0 - */ - styles?: google.maps.MapTypeStyle[] | null; - /** - * A map id associated with a specific map style or feature. - * - * [Use Map IDs](https://developers.google.com/maps/documentation/get-map-id) - * - * Only for Web. - * - * @since 5.4.0 - */ - mapId?: string; - /** - * A map id associated with a specific map style or feature. - * - * [Use Map IDs](https://developers.google.com/maps/documentation/get-map-id) - * - * Only for Android. - * - * @since 5.4.0 - */ - androidMapId?: string; - /** - * A map id associated with a specific map style or feature. - * - * [Use Map IDs](https://developers.google.com/maps/documentation/get-map-id) - * - * Only for iOS. - * - * @since 5.4.0 - */ - iOSMapId?: string; -} - -/** - * Configuration properties for a Google Map Camera - */ -export interface CameraConfig { - /** - * Location on the Earth towards which the camera points. - */ - coordinate?: LatLng; - /** - * Sets the zoom of the map. - */ - zoom?: number; - /** - * Bearing of the camera, in degrees clockwise from true north. - * - * @default 0 - */ - bearing?: number; - /** - * The angle, in degrees, of the camera from the nadir (directly facing the Earth). - * - * The only allowed values are 0 and 45. - * - * @default 0 - */ - angle?: number; - /** - * Animate the transition to the new Camera properties. - * - * @default false - */ - animate?: boolean; - - /** - * This configuration option is not being used. - */ - animationDuration?: number; -} - -export enum MapType { - /** - * Basic map. - */ - Normal = 'Normal', - /** - * Satellite imagery with roads and labels. - */ - Hybrid = 'Hybrid', - /** - * Satellite imagery with no labels. - */ - Satellite = 'Satellite', - /** - * Topographic data. - */ - Terrain = 'Terrain', - /** - * No base map tiles. - */ - None = 'None', -} - -/** - * Controls for setting padding on the 'visible' region of the view. - */ -export interface MapPadding { - top: number; - left: number; - right: number; - bottom: number; -} - -/** - * A marker is an icon placed at a particular point on the map's surface. - */ -export interface Marker { - /** - * Marker position - */ - coordinate: LatLng; - /** - * Sets the opacity of the marker, between 0 (completely transparent) and 1 inclusive. - * - * @default 1 - */ - opacity?: number; - /** - * Title, a short description of the overlay. - */ - title?: string; - /** - * Snippet text, shown beneath the title in the info window when selected. - */ - snippet?: string; - /** - * Controls whether this marker should be flat against the Earth's surface or a billboard facing the camera. - * - * @default false - */ - isFlat?: boolean; - /** - * Path to a marker icon to render. It can be relative to the web app public directory, - * or a https url of a remote marker icon. - * - * **SVGs are not supported on native platforms.** - * - * @usage - * ```typescript - * { - * ... - * iconUrl: 'assets/icon/pin.png', - * ... - * } - * ``` - * - * @since 4.2.0 - */ - iconUrl?: string; - /** - * Controls the scaled size of the marker image set in `iconUrl`. - * - * @since 4.2.0 - */ - iconSize?: Size; - - /** - * The position of the image within a sprite, if any. By default, the origin is located at the top left corner of the image . - * - * @since 4.2.0 - */ - iconOrigin?: Point; - - /** - * The position at which to anchor an image in correspondence to the location of the marker on the map. By default, the anchor is located along the center point of the bottom of the image. - * - * @since 4.2.0 - */ - iconAnchor?: Point; - /** - * Customizes the color of the default marker image. Each value must be between 0 and 255. - * - * Only for iOS and Android. - * - * @since 4.2.0 - */ - tintColor?: { - r: number; - g: number; - b: number; - a: number; - }; - - /** - * Controls whether this marker can be dragged interactively - * - * @default false - */ - draggable?: boolean; - - /** - * Specifies the stack order of this marker, relative to other markers on the map. - * A marker with a high z-index is drawn on top of markers with lower z-indexes - * - * @default 0 - */ - zIndex?: number; -} - -/** - * The callback function to be called when map events are emitted. - */ -export type MapListenerCallback = (data: T) => void; - -export interface MapReadyCallbackData { - mapId: string; -} - -export interface MarkerCallbackData { - markerId: string; - latitude: number; - longitude: number; - title: string; - snippet: string; -} - -export interface PolylineCallbackData { - polylineId: string; - tag?: string; -} - -export interface CameraIdleCallbackData { - mapId: string; - bounds: LatLngBounds; - bearing: number; - latitude: number; - longitude: number; - tilt: number; - zoom: number; -} - -export interface CameraMoveStartedCallbackData { - mapId: string; - isGesture: boolean; -} - -export interface ClusterClickCallbackData { - mapId: string; - latitude: number; - longitude: number; - size: number; - items: MarkerCallbackData[]; -} - -export interface MapClickCallbackData { - mapId: string; - latitude: number; - longitude: number; -} - -export interface MarkerClickCallbackData extends MarkerCallbackData { - mapId: string; -} - -export interface PolygonClickCallbackData { - mapId: string; - polygonId: string; - tag?: string; -} - -export interface CircleClickCallbackData { - mapId: string; - circleId: string; - tag?: string; -} - -export interface MyLocationButtonClickCallbackData { - mapId: string; -} diff --git a/google-maps/src/implementation.ts b/google-maps/src/implementation.ts deleted file mode 100644 index 76555ada0..000000000 --- a/google-maps/src/implementation.ts +++ /dev/null @@ -1,227 +0,0 @@ -import type { Plugin } from '@capacitor/core'; -import { registerPlugin } from '@capacitor/core'; - -import type { - CameraConfig, - Circle, - GoogleMapConfig, - LatLng, - LatLngBounds, - MapPadding, - MapType, - Marker, - Polygon, - Polyline, -} from './definitions'; - -/** - * An interface containing the options used when creating a map. - */ -export interface CreateMapArgs { - /** - * A unique identifier for the map instance. - */ - id: string; - /** - * The Google Maps SDK API Key. - */ - apiKey: string; - /** - * The initial configuration settings for the map. - */ - config: GoogleMapConfig; - /** - * The DOM element that the Google Map View will be mounted on which determines size and positioning. - */ - element: HTMLElement; - /** - * Destroy and re-create the map instance if a map with the supplied id already exists - * @default false - */ - forceCreate?: boolean; - /** - * The region parameter alters your application to serve different map tiles or bias the application (such as biasing geocoding results towards the region). - * - * Only available for web. - */ - region?: string; - - /** - * The language parameter affects the names of controls, copyright notices, driving directions, and control labels, as well as the responses to service requests. - * - * Only available for web. - */ - language?: string; -} - -export interface DestroyMapArgs { - id: string; -} - -export interface RemoveMarkerArgs { - id: string; - markerId: string; -} - -export interface RemoveMarkersArgs { - id: string; - markerIds: string[]; -} - -export interface AddMarkerArgs { - id: string; - marker: Marker; -} - -export interface AddPolygonsArgs { - id: string; - polygons: Polygon[]; -} - -export interface RemovePolygonsArgs { - id: string; - polygonIds: string[]; -} - -export interface AddCirclesArgs { - id: string; - circles: Circle[]; -} - -export interface RemoveCirclesArgs { - id: string; - circleIds: string[]; -} -export interface AddPolylinesArgs { - id: string; - polylines: Polyline[]; -} - -export interface RemovePolylinesArgs { - id: string; - polylineIds: string[]; -} - -export interface CameraArgs { - id: string; - config: CameraConfig; -} - -export interface MapTypeArgs { - id: string; - mapType: MapType; -} - -export interface IndoorMapArgs { - id: string; - enabled: boolean; -} - -export interface TrafficLayerArgs { - id: string; - enabled: boolean; -} - -export interface AccElementsArgs { - id: string; - enabled: boolean; -} - -export interface PaddingArgs { - id: string; - padding: MapPadding; -} - -export interface CurrentLocArgs { - id: string; - enabled: boolean; -} -export interface AddMarkersArgs { - id: string; - markers: Marker[]; -} - -export interface MapBoundsArgs { - id: string; - mapBounds: { - x: number; - y: number; - width: number; - height: number; - }; -} - -export interface MapBoundsContainsArgs { - bounds: LatLngBounds; - point: LatLng; -} - -export type MapBoundsExtendArgs = MapBoundsContainsArgs; - -export interface EnableClusteringArgs { - id: string; - minClusterSize?: number; -} - -export interface FitBoundsArgs { - id: string; - bounds: LatLngBounds; - padding?: number; -} - -export interface CapacitorGoogleMapsPlugin extends Plugin { - create(options: CreateMapArgs): Promise; - enableTouch(args: { id: string }): Promise; - disableTouch(args: { id: string }): Promise; - addMarker(args: AddMarkerArgs): Promise<{ id: string }>; - addMarkers(args: AddMarkersArgs): Promise<{ ids: string[] }>; - removeMarker(args: RemoveMarkerArgs): Promise; - removeMarkers(args: RemoveMarkersArgs): Promise; - addPolygons(args: AddPolygonsArgs): Promise<{ ids: string[] }>; - removePolygons(args: RemovePolygonsArgs): Promise; - addCircles(args: AddCirclesArgs): Promise<{ ids: string[] }>; - removeCircles(args: RemoveCirclesArgs): Promise; - addPolylines(args: AddPolylinesArgs): Promise<{ ids: string[] }>; - removePolylines(args: RemovePolylinesArgs): Promise; - enableClustering(args: EnableClusteringArgs): Promise; - disableClustering(args: { id: string }): Promise; - destroy(args: DestroyMapArgs): Promise; - setCamera(args: CameraArgs): Promise; - getMapType(args: { id: string }): Promise<{ type: string }>; - setMapType(args: MapTypeArgs): Promise; - enableIndoorMaps(args: IndoorMapArgs): Promise; - enableTrafficLayer(args: TrafficLayerArgs): Promise; - enableAccessibilityElements(args: AccElementsArgs): Promise; - enableCurrentLocation(args: CurrentLocArgs): Promise; - setPadding(args: PaddingArgs): Promise; - onScroll(args: MapBoundsArgs): Promise; - onResize(args: MapBoundsArgs): Promise; - onDisplay(args: MapBoundsArgs): Promise; - dispatchMapEvent(args: { id: string; focus: boolean }): Promise; - getMapBounds(args: { id: string }): Promise; - fitBounds(args: FitBoundsArgs): Promise; - mapBoundsContains( - args: MapBoundsContainsArgs, - ): Promise<{ contains: boolean }>; - mapBoundsExtend(args: MapBoundsExtendArgs): Promise<{ bounds: LatLngBounds }>; -} - -const CapacitorGoogleMaps = registerPlugin( - 'CapacitorGoogleMaps', - { - web: () => import('./web').then(m => new m.CapacitorGoogleMapsWeb()), - }, -); - -CapacitorGoogleMaps.addListener('isMapInFocus', data => { - const x = data.x; - const y = data.y; - - const elem = document.elementFromPoint(x, y) as HTMLElement | null; - const internalId = elem?.dataset?.internalId; - const mapInFocus = internalId === data.mapId; - - CapacitorGoogleMaps.dispatchMapEvent({ id: data.mapId, focus: mapInFocus }); -}); - -export { CapacitorGoogleMaps }; diff --git a/google-maps/src/index.ts b/google-maps/src/index.ts deleted file mode 100644 index aaf949478..000000000 --- a/google-maps/src/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* eslint-disable @typescript-eslint/no-namespace */ -import { - LatLngBounds, - MapType, - Marker, - Polygon, - Circle, - Polyline, - StyleSpan, -} from './definitions'; -import { GoogleMap } from './map'; - -export { - GoogleMap, - LatLngBounds, - MapType, - Marker, - Polygon, - Circle, - Polyline, - StyleSpan, -}; - -declare global { - export namespace JSX { - export interface IntrinsicElements { - 'capacitor-google-map': any; - } - } -} diff --git a/google-maps/src/map.ts b/google-maps/src/map.ts deleted file mode 100644 index 67b6324e6..000000000 --- a/google-maps/src/map.ts +++ /dev/null @@ -1,1153 +0,0 @@ -import { Capacitor } from '@capacitor/core'; -import type { PluginListenerHandle } from '@capacitor/core'; - -import type { - CameraConfig, - Marker, - MapPadding, - MapListenerCallback, - MapReadyCallbackData, - CameraIdleCallbackData, - CameraMoveStartedCallbackData, - ClusterClickCallbackData, - MapClickCallbackData, - MarkerClickCallbackData, - MyLocationButtonClickCallbackData, - Polygon, - PolygonClickCallbackData, - Circle, - CircleClickCallbackData, - Polyline, - PolylineCallbackData, -} from './definitions'; -import { LatLngBounds, MapType } from './definitions'; -import type { CreateMapArgs } from './implementation'; -import { CapacitorGoogleMaps } from './implementation'; - -export interface GoogleMapInterface { - create( - options: CreateMapArgs, - callback?: MapListenerCallback, - ): Promise; - enableTouch(): Promise; - disableTouch(): Promise; - enableClustering( - /** - * The minimum number of markers that can be clustered together. The default is 4 markers. - */ - minClusterSize?: number, - ): Promise; - disableClustering(): Promise; - addMarker(marker: Marker): Promise; - addMarkers(markers: Marker[]): Promise; - removeMarker(id: string): Promise; - removeMarkers(ids: string[]): Promise; - addPolygons(polygons: Polygon[]): Promise; - removePolygons(ids: string[]): Promise; - addCircles(circles: Circle[]): Promise; - removeCircles(ids: string[]): Promise; - addPolylines(polylines: Polyline[]): Promise; - removePolylines(ids: string[]): Promise; - destroy(): Promise; - setCamera(config: CameraConfig): Promise; - /** - * Get current map type - */ - getMapType(): Promise; - setMapType(mapType: MapType): Promise; - enableIndoorMaps(enabled: boolean): Promise; - enableTrafficLayer(enabled: boolean): Promise; - enableAccessibilityElements(enabled: boolean): Promise; - enableCurrentLocation(enabled: boolean): Promise; - setPadding(padding: MapPadding): Promise; - /** - * Sets the map viewport to contain the given bounds. - * @param bounds The bounds to fit in the viewport. - * @param padding Optional padding to apply in pixels. The bounds will be fit in the part of the map that remains after padding is removed. - */ - fitBounds(bounds: LatLngBounds, padding?: number): Promise; - setOnBoundsChangedListener( - callback?: MapListenerCallback, - ): Promise; - setOnCameraIdleListener( - callback?: MapListenerCallback, - ): Promise; - setOnCameraMoveStartedListener( - callback?: MapListenerCallback, - ): Promise; - setOnClusterClickListener( - callback?: MapListenerCallback, - ): Promise; - setOnClusterInfoWindowClickListener( - callback?: MapListenerCallback, - ): Promise; - setOnInfoWindowClickListener( - callback?: MapListenerCallback, - ): Promise; - setOnMapClickListener( - callback?: MapListenerCallback, - ): Promise; - setOnMarkerClickListener( - callback?: MapListenerCallback, - ): Promise; - setOnPolygonClickListener( - callback?: MapListenerCallback, - ): Promise; - setOnCircleClickListener( - callback?: MapListenerCallback, - ): Promise; - setOnPolylineClickListener( - callback?: MapListenerCallback, - ): Promise; - setOnMarkerDragStartListener( - callback?: MapListenerCallback, - ): Promise; - setOnMarkerDragListener( - callback?: MapListenerCallback, - ): Promise; - setOnMarkerDragEndListener( - callback?: MapListenerCallback, - ): Promise; - setOnMyLocationButtonClickListener( - callback?: MapListenerCallback, - ): Promise; - setOnMyLocationClickListener( - callback?: MapListenerCallback, - ): Promise; -} - -class MapCustomElement extends HTMLElement { - constructor() { - super(); - } - - connectedCallback() { - this.innerHTML = ''; - - if (Capacitor.getPlatform() == 'ios') { - this.style.overflow = 'scroll'; - (this.style as any)['-webkit-overflow-scrolling'] = 'touch'; - - const overflowDiv = document.createElement('div'); - overflowDiv.style.height = '200%'; - - this.appendChild(overflowDiv); - } - } -} - -customElements.define('capacitor-google-map', MapCustomElement); - -export class GoogleMap { - private id: string; - private element: HTMLElement | null = null; - private resizeObserver: ResizeObserver | null = null; - - private onBoundsChangedListener?: PluginListenerHandle; - private onCameraIdleListener?: PluginListenerHandle; - private onCameraMoveStartedListener?: PluginListenerHandle; - private onClusterClickListener?: PluginListenerHandle; - private onClusterInfoWindowClickListener?: PluginListenerHandle; - private onInfoWindowClickListener?: PluginListenerHandle; - private onMapClickListener?: PluginListenerHandle; - private onPolylineClickListener?: PluginListenerHandle; - private onMarkerClickListener?: PluginListenerHandle; - private onPolygonClickListener?: PluginListenerHandle; - private onCircleClickListener?: PluginListenerHandle; - private onMarkerDragStartListener?: PluginListenerHandle; - private onMarkerDragListener?: PluginListenerHandle; - private onMarkerDragEndListener?: PluginListenerHandle; - private onMyLocationButtonClickListener?: PluginListenerHandle; - private onMyLocationClickListener?: PluginListenerHandle; - - private constructor(id: string) { - this.id = id; - } - - /** - * Creates a new instance of a Google Map - * @param options - * @param callback - * @returns GoogleMap - */ - public static async create( - options: CreateMapArgs, - callback?: MapListenerCallback, - ): Promise { - const newMap = new GoogleMap(options.id); - - if (!options.element) { - throw new Error('container element is required'); - } - - if (options.config.androidLiteMode === undefined) { - options.config.androidLiteMode = false; - } - - newMap.element = options.element; - newMap.element.dataset.internalId = options.id; - - const elementBounds = await GoogleMap.getElementBounds(options.element); - options.config.width = elementBounds.width; - options.config.height = elementBounds.height; - options.config.x = elementBounds.x; - options.config.y = elementBounds.y; - options.config.devicePixelRatio = window.devicePixelRatio; - - if (Capacitor.getPlatform() == 'android') { - newMap.initScrolling(); - } - - if (Capacitor.isNativePlatform()) { - (options.element as any) = {}; - - const getMapBounds = () => { - const mapRect = - newMap.element?.getBoundingClientRect() ?? ({} as DOMRect); - return { - x: mapRect.x, - y: mapRect.y, - width: mapRect.width, - height: mapRect.height, - }; - }; - - const onDisplay = () => { - CapacitorGoogleMaps.onDisplay({ - id: newMap.id, - mapBounds: getMapBounds(), - }); - }; - - const onResize = () => { - CapacitorGoogleMaps.onResize({ - id: newMap.id, - mapBounds: getMapBounds(), - }); - }; - - const ionicPage = newMap.element.closest('.ion-page'); - if (Capacitor.getPlatform() === 'ios' && ionicPage) { - ionicPage.addEventListener('ionViewWillEnter', () => { - setTimeout(() => { - onDisplay(); - }, 100); - }); - ionicPage.addEventListener('ionViewDidEnter', () => { - setTimeout(() => { - onDisplay(); - }, 100); - }); - } - - const lastState = { - width: elementBounds.width, - height: elementBounds.height, - isHidden: false, - }; - newMap.resizeObserver = new ResizeObserver(() => { - if (newMap.element != null) { - const mapRect = newMap.element.getBoundingClientRect(); - - const isHidden = mapRect.width === 0 && mapRect.height === 0; - if (!isHidden) { - if (lastState.isHidden) { - if (Capacitor.getPlatform() === 'ios' && !ionicPage) { - onDisplay(); - } - } else if ( - lastState.width !== mapRect.width || - lastState.height !== mapRect.height - ) { - onResize(); - } - } - - lastState.width = mapRect.width; - lastState.height = mapRect.height; - lastState.isHidden = isHidden; - } - }); - newMap.resizeObserver.observe(newMap.element); - } - - // small delay to allow for iOS WKWebView to setup corresponding element sub-scroll views ??? - await new Promise((resolve, reject) => { - setTimeout(async () => { - try { - await CapacitorGoogleMaps.create(options); - resolve(undefined); - } catch (err) { - reject(err); - } - }, 200); - }); - - if (callback) { - const onMapReadyListener = await CapacitorGoogleMaps.addListener( - 'onMapReady', - (data: MapReadyCallbackData) => { - if (data.mapId == newMap.id) { - callback(data); - onMapReadyListener.remove(); - } - }, - ); - } - - return newMap; - } - - private static async getElementBounds( - element: HTMLElement, - ): Promise { - return new Promise(resolve => { - let elementBounds = element.getBoundingClientRect(); - if (elementBounds.width == 0) { - let retries = 0; - const boundsInterval = setInterval(function () { - if (elementBounds.width == 0 && retries < 30) { - elementBounds = element.getBoundingClientRect(); - retries++; - } else { - if (retries == 30) { - console.warn('Map size could not be determined'); - } - clearInterval(boundsInterval); - resolve(elementBounds); - } - }, 100); - } else { - resolve(elementBounds); - } - }); - } - - /** - * Enable touch events on native map - * - * @returns void - */ - async enableTouch(): Promise { - return CapacitorGoogleMaps.enableTouch({ - id: this.id, - }); - } - - /** - * Disable touch events on native map - * - * @returns void - */ - async disableTouch(): Promise { - return CapacitorGoogleMaps.disableTouch({ - id: this.id, - }); - } - - /** - * Enable marker clustering - * - * @param minClusterSize - The minimum number of markers that can be clustered together. - * @defaultValue 4 - * - * @returns void - */ - async enableClustering(minClusterSize?: number): Promise { - return CapacitorGoogleMaps.enableClustering({ - id: this.id, - minClusterSize, - }); - } - - /** - * Disable marker clustering - * - * @returns void - */ - async disableClustering(): Promise { - return CapacitorGoogleMaps.disableClustering({ - id: this.id, - }); - } - - /** - * Adds a marker to the map - * - * @param marker - * @returns created marker id - */ - async addMarker(marker: Marker): Promise { - const res = await CapacitorGoogleMaps.addMarker({ - id: this.id, - marker, - }); - - return res.id; - } - - /** - * Adds multiple markers to the map - * - * @param markers - * @returns array of created marker IDs - */ - async addMarkers(markers: Marker[]): Promise { - const res = await CapacitorGoogleMaps.addMarkers({ - id: this.id, - markers, - }); - - return res.ids; - } - - /** - * Remove marker from the map - * - * @param id id of the marker to remove from the map - * @returns - */ - async removeMarker(id: string): Promise { - return CapacitorGoogleMaps.removeMarker({ - id: this.id, - markerId: id, - }); - } - - /** - * Remove markers from the map - * - * @param ids array of ids to remove from the map - * @returns - */ - async removeMarkers(ids: string[]): Promise { - return CapacitorGoogleMaps.removeMarkers({ - id: this.id, - markerIds: ids, - }); - } - - async addPolygons(polygons: Polygon[]): Promise { - const res = await CapacitorGoogleMaps.addPolygons({ - id: this.id, - polygons, - }); - - return res.ids; - } - - async addPolylines(polylines: Polyline[]): Promise { - const res = await CapacitorGoogleMaps.addPolylines({ - id: this.id, - polylines, - }); - - return res.ids; - } - - async removePolygons(ids: string[]): Promise { - return CapacitorGoogleMaps.removePolygons({ - id: this.id, - polygonIds: ids, - }); - } - - async addCircles(circles: Circle[]): Promise { - const res = await CapacitorGoogleMaps.addCircles({ - id: this.id, - circles, - }); - - return res.ids; - } - - async removeCircles(ids: string[]): Promise { - return CapacitorGoogleMaps.removeCircles({ - id: this.id, - circleIds: ids, - }); - } - - async removePolylines(ids: string[]): Promise { - return CapacitorGoogleMaps.removePolylines({ - id: this.id, - polylineIds: ids, - }); - } - - /** - * Destroy the current instance of the map - */ - async destroy(): Promise { - if (Capacitor.getPlatform() == 'android') { - this.disableScrolling(); - } - - if (Capacitor.isNativePlatform()) { - this.resizeObserver?.disconnect(); - } - - this.removeAllMapListeners(); - - return CapacitorGoogleMaps.destroy({ - id: this.id, - }); - } - - /** - * Update the map camera configuration - * - * @param config - * @returns - */ - async setCamera(config: CameraConfig): Promise { - return CapacitorGoogleMaps.setCamera({ - id: this.id, - config, - }); - } - - async getMapType(): Promise { - const { type } = await CapacitorGoogleMaps.getMapType({ id: this.id }); - return MapType[type as keyof typeof MapType]; - } - - /** - * Sets the type of map tiles that should be displayed. - * - * @param mapType - * @returns - */ - async setMapType(mapType: MapType): Promise { - return CapacitorGoogleMaps.setMapType({ - id: this.id, - mapType, - }); - } - - /** - * Sets whether indoor maps are shown, where available. - * - * @param enabled - * @returns - */ - async enableIndoorMaps(enabled: boolean): Promise { - return CapacitorGoogleMaps.enableIndoorMaps({ - id: this.id, - enabled, - }); - } - - /** - * Controls whether the map is drawing traffic data, if available. - * - * @param enabled - * @returns - */ - async enableTrafficLayer(enabled: boolean): Promise { - return CapacitorGoogleMaps.enableTrafficLayer({ - id: this.id, - enabled, - }); - } - - /** - * Show accessibility elements for overlay objects, such as Marker and Polyline. - * - * Only available on iOS. - * - * @param enabled - * @returns - */ - async enableAccessibilityElements(enabled: boolean): Promise { - return CapacitorGoogleMaps.enableAccessibilityElements({ - id: this.id, - enabled, - }); - } - - /** - * Set whether the My Location dot and accuracy circle is enabled. - * - * @param enabled - * @returns - */ - async enableCurrentLocation(enabled: boolean): Promise { - return CapacitorGoogleMaps.enableCurrentLocation({ - id: this.id, - enabled, - }); - } - - /** - * Set padding on the 'visible' region of the view. - * - * @param padding - * @returns - */ - async setPadding(padding: MapPadding): Promise { - return CapacitorGoogleMaps.setPadding({ - id: this.id, - padding, - }); - } - - /** - * Get the map's current viewport latitude and longitude bounds. - * - * @returns {LatLngBounds} - */ - async getMapBounds(): Promise { - return new LatLngBounds( - await CapacitorGoogleMaps.getMapBounds({ - id: this.id, - }), - ); - } - - async fitBounds(bounds: LatLngBounds, padding?: number): Promise { - return CapacitorGoogleMaps.fitBounds({ - id: this.id, - bounds, - padding, - }); - } - - initScrolling(): void { - const ionContents = document.getElementsByTagName('ion-content'); - - // eslint-disable-next-line @typescript-eslint/prefer-for-of - for (let i = 0; i < ionContents.length; i++) { - (ionContents[i] as any).scrollEvents = true; - } - - window.addEventListener('ionScroll', this.handleScrollEvent); - window.addEventListener('scroll', this.handleScrollEvent); - window.addEventListener('resize', this.handleScrollEvent); - if (screen.orientation) { - screen.orientation.addEventListener('change', () => { - setTimeout(this.updateMapBounds, 500); - }); - } else { - window.addEventListener('orientationchange', () => { - setTimeout(this.updateMapBounds, 500); - }); - } - } - - disableScrolling(): void { - window.removeEventListener('ionScroll', this.handleScrollEvent); - window.removeEventListener('scroll', this.handleScrollEvent); - window.removeEventListener('resize', this.handleScrollEvent); - if (screen.orientation) { - screen.orientation.removeEventListener('change', () => { - setTimeout(this.updateMapBounds, 1000); - }); - } else { - window.removeEventListener('orientationchange', () => { - setTimeout(this.updateMapBounds, 1000); - }); - } - } - - handleScrollEvent = (): void => this.updateMapBounds(); - - private updateMapBounds(): void { - if (this.element) { - const mapRect = this.element.getBoundingClientRect(); - - CapacitorGoogleMaps.onScroll({ - id: this.id, - mapBounds: { - x: mapRect.x, - y: mapRect.y, - width: mapRect.width, - height: mapRect.height, - }, - }); - } - } - - /* - private findContainerElement(): HTMLElement | null { - if (!this.element) { - return null; - } - - let parentElement = this.element.parentElement; - while (parentElement !== null) { - if (window.getComputedStyle(parentElement).overflowY !== 'hidden') { - return parentElement; - } - - parentElement = parentElement.parentElement; - } - - return null; - } - */ - - /** - * Set the event listener on the map for 'onCameraIdle' events. - * - * @param callback - * @returns - */ - async setOnCameraIdleListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onCameraIdleListener) { - this.onCameraIdleListener.remove(); - } - - if (callback) { - this.onCameraIdleListener = await CapacitorGoogleMaps.addListener( - 'onCameraIdle', - this.generateCallback(callback), - ); - } else { - this.onCameraIdleListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onBoundsChanged' events. - * - * @param callback - * @returns - */ - async setOnBoundsChangedListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onBoundsChangedListener) { - this.onBoundsChangedListener.remove(); - } - - if (callback) { - this.onBoundsChangedListener = await CapacitorGoogleMaps.addListener( - 'onBoundsChanged', - this.generateCallback(callback), - ); - } else { - this.onBoundsChangedListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onCameraMoveStarted' events. - * - * @param callback - * @returns - */ - async setOnCameraMoveStartedListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onCameraMoveStartedListener) { - this.onCameraMoveStartedListener.remove(); - } - - if (callback) { - this.onCameraMoveStartedListener = await CapacitorGoogleMaps.addListener( - 'onCameraMoveStarted', - this.generateCallback(callback), - ); - } else { - this.onCameraMoveStartedListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onClusterClick' events. - * - * @param callback - * @returns - */ - async setOnClusterClickListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onClusterClickListener) { - this.onClusterClickListener.remove(); - } - - if (callback) { - this.onClusterClickListener = await CapacitorGoogleMaps.addListener( - 'onClusterClick', - this.generateCallback(callback), - ); - } else { - this.onClusterClickListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onClusterInfoWindowClick' events. - * - * @param callback - * @returns - */ - async setOnClusterInfoWindowClickListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onClusterInfoWindowClickListener) { - this.onClusterInfoWindowClickListener.remove(); - } - - if (callback) { - this.onClusterInfoWindowClickListener = - await CapacitorGoogleMaps.addListener( - 'onClusterInfoWindowClick', - this.generateCallback(callback), - ); - } else { - this.onClusterInfoWindowClickListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onInfoWindowClick' events. - * - * @param callback - * @returns - */ - async setOnInfoWindowClickListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onInfoWindowClickListener) { - this.onInfoWindowClickListener.remove(); - } - - if (callback) { - this.onInfoWindowClickListener = await CapacitorGoogleMaps.addListener( - 'onInfoWindowClick', - this.generateCallback(callback), - ); - } else { - this.onInfoWindowClickListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onMapClick' events. - * - * @param callback - * @returns - */ - async setOnMapClickListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onMapClickListener) { - this.onMapClickListener.remove(); - } - - if (callback) { - this.onMapClickListener = await CapacitorGoogleMaps.addListener( - 'onMapClick', - this.generateCallback(callback), - ); - } else { - this.onMapClickListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onPolygonClick' events. - * - * @param callback - * @returns - */ - async setOnPolygonClickListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onPolygonClickListener) { - this.onPolygonClickListener.remove(); - } - - if (callback) { - this.onPolygonClickListener = await CapacitorGoogleMaps.addListener( - 'onPolygonClick', - this.generateCallback(callback), - ); - } else { - this.onPolygonClickListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onCircleClick' events. - * - * @param callback - * @returns - */ - async setOnCircleClickListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onCircleClickListener) [this.onCircleClickListener.remove()]; - - if (callback) { - this.onCircleClickListener = await CapacitorGoogleMaps.addListener( - 'onCircleClick', - this.generateCallback(callback), - ); - } else { - this.onCircleClickListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onMarkerClick' events. - * - * @param callback - * @returns - */ - async setOnMarkerClickListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onMarkerClickListener) { - this.onMarkerClickListener.remove(); - } - - if (callback) { - this.onMarkerClickListener = await CapacitorGoogleMaps.addListener( - 'onMarkerClick', - this.generateCallback(callback), - ); - } else { - this.onMarkerClickListener = undefined; - } - } - /** - * Set the event listener on the map for 'onPolylineClick' events. - * - * @param callback - * @returns - */ - async setOnPolylineClickListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onPolylineClickListener) { - this.onPolylineClickListener.remove(); - } - - if (callback) { - this.onPolylineClickListener = await CapacitorGoogleMaps.addListener( - 'onPolylineClick', - this.generateCallback(callback), - ); - } else { - this.onPolylineClickListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onMarkerDragStart' events. - * - * @param callback - * @returns - */ - async setOnMarkerDragStartListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onMarkerDragStartListener) { - this.onMarkerDragStartListener.remove(); - } - - if (callback) { - this.onMarkerDragStartListener = await CapacitorGoogleMaps.addListener( - 'onMarkerDragStart', - this.generateCallback(callback), - ); - } else { - this.onMarkerDragStartListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onMarkerDrag' events. - * - * @param callback - * @returns - */ - async setOnMarkerDragListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onMarkerDragListener) { - this.onMarkerDragListener.remove(); - } - - if (callback) { - this.onMarkerDragListener = await CapacitorGoogleMaps.addListener( - 'onMarkerDrag', - this.generateCallback(callback), - ); - } else { - this.onMarkerDragListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onMarkerDragEnd' events. - * - * @param callback - * @returns - */ - async setOnMarkerDragEndListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onMarkerDragEndListener) { - this.onMarkerDragEndListener.remove(); - } - - if (callback) { - this.onMarkerDragEndListener = await CapacitorGoogleMaps.addListener( - 'onMarkerDragEnd', - this.generateCallback(callback), - ); - } else { - this.onMarkerDragEndListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onMyLocationButtonClick' events. - * - * @param callback - * @returns - */ - async setOnMyLocationButtonClickListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onMyLocationButtonClickListener) { - this.onMyLocationButtonClickListener.remove(); - } - - if (callback) { - this.onMyLocationButtonClickListener = - await CapacitorGoogleMaps.addListener( - 'onMyLocationButtonClick', - this.generateCallback(callback), - ); - } else { - this.onMyLocationButtonClickListener = undefined; - } - } - - /** - * Set the event listener on the map for 'onMyLocationClick' events. - * - * @param callback - * @returns - */ - async setOnMyLocationClickListener( - callback?: MapListenerCallback, - ): Promise { - if (this.onMyLocationClickListener) { - this.onMyLocationClickListener.remove(); - } - - if (callback) { - this.onMyLocationClickListener = await CapacitorGoogleMaps.addListener( - 'onMyLocationClick', - this.generateCallback(callback), - ); - } else { - this.onMyLocationClickListener = undefined; - } - } - - /** - * Remove all event listeners on the map. - * - * @param callback - * @returns - */ - async removeAllMapListeners(): Promise { - if (this.onBoundsChangedListener) { - this.onBoundsChangedListener.remove(); - this.onBoundsChangedListener = undefined; - } - if (this.onCameraIdleListener) { - this.onCameraIdleListener.remove(); - this.onCameraIdleListener = undefined; - } - if (this.onCameraMoveStartedListener) { - this.onCameraMoveStartedListener.remove(); - this.onCameraMoveStartedListener = undefined; - } - - if (this.onClusterClickListener) { - this.onClusterClickListener.remove(); - this.onClusterClickListener = undefined; - } - - if (this.onClusterInfoWindowClickListener) { - this.onClusterInfoWindowClickListener.remove(); - this.onClusterInfoWindowClickListener = undefined; - } - - if (this.onInfoWindowClickListener) { - this.onInfoWindowClickListener.remove(); - this.onInfoWindowClickListener = undefined; - } - - if (this.onMapClickListener) { - this.onMapClickListener.remove(); - this.onMapClickListener = undefined; - } - - if (this.onPolylineClickListener) { - this.onPolylineClickListener.remove(); - this.onPolylineClickListener = undefined; - } - - if (this.onMarkerClickListener) { - this.onMarkerClickListener.remove(); - this.onMarkerClickListener = undefined; - } - - if (this.onPolygonClickListener) { - this.onPolygonClickListener.remove(); - this.onPolygonClickListener = undefined; - } - - if (this.onCircleClickListener) { - this.onCircleClickListener.remove(); - this.onCircleClickListener = undefined; - } - - if (this.onMarkerDragStartListener) { - this.onMarkerDragStartListener.remove(); - this.onMarkerDragStartListener = undefined; - } - - if (this.onMarkerDragListener) { - this.onMarkerDragListener.remove(); - this.onMarkerDragListener = undefined; - } - - if (this.onMarkerDragEndListener) { - this.onMarkerDragEndListener.remove(); - this.onMarkerDragEndListener = undefined; - } - - if (this.onMyLocationButtonClickListener) { - this.onMyLocationButtonClickListener.remove(); - this.onMyLocationButtonClickListener = undefined; - } - - if (this.onMyLocationClickListener) { - this.onMyLocationClickListener.remove(); - this.onMyLocationClickListener = undefined; - } - } - - private generateCallback( - callback: MapListenerCallback, - ): MapListenerCallback { - const mapId = this.id; - return (data: any) => { - if (data.mapId == mapId) { - callback(data); - } - }; - } -} diff --git a/google-maps/src/web.ts b/google-maps/src/web.ts deleted file mode 100644 index 5b82addec..000000000 --- a/google-maps/src/web.ts +++ /dev/null @@ -1,673 +0,0 @@ -import { WebPlugin } from '@capacitor/core'; -import type { - Cluster, - onClusterClickHandler, -} from '@googlemaps/markerclusterer'; -import { - MarkerClusterer, - SuperClusterAlgorithm, -} from '@googlemaps/markerclusterer'; - -import type { Marker } from './definitions'; -import { MapType, LatLngBounds } from './definitions'; -import type { - AddMarkerArgs, - CameraArgs, - AddMarkersArgs, - CapacitorGoogleMapsPlugin, - CreateMapArgs, - CurrentLocArgs, - DestroyMapArgs, - MapTypeArgs, - PaddingArgs, - RemoveMarkerArgs, - TrafficLayerArgs, - RemoveMarkersArgs, - MapBoundsContainsArgs, - EnableClusteringArgs, - FitBoundsArgs, - MapBoundsExtendArgs, - AddPolygonsArgs, - RemovePolygonsArgs, - AddCirclesArgs, - RemoveCirclesArgs, - AddPolylinesArgs, - RemovePolylinesArgs, -} from './implementation'; - -export class CapacitorGoogleMapsWeb - extends WebPlugin - implements CapacitorGoogleMapsPlugin -{ - private gMapsRef: typeof google.maps | undefined = undefined; - private maps: { - [id: string]: { - element: HTMLElement; - map: google.maps.Map; - markers: { - [id: string]: google.maps.Marker; - }; - polygons: { - [id: string]: google.maps.Polygon; - }; - circles: { - [id: string]: google.maps.Circle; - }; - polylines: { - [id: string]: google.maps.Polyline; - }; - markerClusterer?: MarkerClusterer; - trafficLayer?: google.maps.TrafficLayer; - }; - } = {}; - private currMarkerId = 0; - private currPolygonId = 0; - private currCircleId = 0; - private currPolylineId = 0; - - private onClusterClickHandler: onClusterClickHandler = ( - _: google.maps.MapMouseEvent, - cluster: Cluster, - map: google.maps.Map, - ): void => { - const mapId = this.getIdFromMap(map); - const items: any[] = []; - - if (cluster.markers != undefined) { - for (const marker of cluster.markers) { - const markerId = this.getIdFromMarker(mapId, marker); - - items.push({ - markerId: markerId, - latitude: marker.getPosition()?.lat(), - longitude: marker.getPosition()?.lng(), - title: marker.getTitle(), - snippet: '', - }); - } - } - - this.notifyListeners('onClusterClick', { - mapId: mapId, - latitude: cluster.position.lat(), - longitude: cluster.position.lng(), - size: cluster.count, - items: items, - }); - }; - - private getIdFromMap(map: google.maps.Map): string { - for (const id in this.maps) { - if (this.maps[id].map == map) { - return id; - } - } - - return ''; - } - - private getIdFromMarker(mapId: string, marker: google.maps.Marker): string { - for (const id in this.maps[mapId].markers) { - if (this.maps[mapId].markers[id] == marker) { - return id; - } - } - - return ''; - } - - private async importGoogleLib( - apiKey: string, - region?: string, - language?: string, - ) { - if (this.gMapsRef === undefined) { - const lib = await import('@googlemaps/js-api-loader'); - const loader = new lib.Loader({ - apiKey: apiKey ?? '', - version: 'weekly', - libraries: ['places'], - language, - region, - }); - const google = await loader.load(); - this.gMapsRef = google.maps; - console.log('Loaded google maps API'); - } - } - - async enableTouch(_args: { id: string }): Promise { - this.maps[_args.id].map.setOptions({ gestureHandling: 'auto' }); - } - - async disableTouch(_args: { id: string }): Promise { - this.maps[_args.id].map.setOptions({ gestureHandling: 'none' }); - } - - async setCamera(_args: CameraArgs): Promise { - // Animation not supported yet... - this.maps[_args.id].map.moveCamera({ - center: _args.config.coordinate, - heading: _args.config.bearing, - tilt: _args.config.angle, - zoom: _args.config.zoom, - }); - } - - async getMapType(_args: { id: string }): Promise<{ type: string }> { - let type = this.maps[_args.id].map.getMapTypeId(); - if (type !== undefined) { - if (type === 'roadmap') { - type = MapType.Normal; - } - return { type: `${type.charAt(0).toUpperCase()}${type.slice(1)}` }; - } - throw new Error('Map type is undefined'); - } - - async setMapType(_args: MapTypeArgs): Promise { - let mapType = _args.mapType.toLowerCase(); - if (_args.mapType === MapType.Normal) { - mapType = 'roadmap'; - } - this.maps[_args.id].map.setMapTypeId(mapType); - } - - async enableIndoorMaps(): Promise { - throw new Error('Method not supported on web.'); - } - - async enableTrafficLayer(_args: TrafficLayerArgs): Promise { - const trafficLayer = - this.maps[_args.id].trafficLayer ?? new google.maps.TrafficLayer(); - - if (_args.enabled) { - trafficLayer.setMap(this.maps[_args.id].map); - this.maps[_args.id].trafficLayer = trafficLayer; - } else if (this.maps[_args.id].trafficLayer) { - trafficLayer.setMap(null); - this.maps[_args.id].trafficLayer = undefined; - } - } - - async enableAccessibilityElements(): Promise { - throw new Error('Method not supported on web.'); - } - - dispatchMapEvent(): Promise { - throw new Error('Method not supported on web.'); - } - - async enableCurrentLocation(_args: CurrentLocArgs): Promise { - if (_args.enabled) { - if (navigator.geolocation) { - navigator.geolocation.getCurrentPosition( - (position: GeolocationPosition) => { - const pos = { - lat: position.coords.latitude, - lng: position.coords.longitude, - }; - - this.maps[_args.id].map.setCenter(pos); - - this.notifyListeners('onMyLocationButtonClick', {}); - - this.notifyListeners('onMyLocationClick', {}); - }, - () => { - throw new Error('Geolocation not supported on web browser.'); - }, - ); - } else { - throw new Error('Geolocation not supported on web browser.'); - } - } - } - async setPadding(_args: PaddingArgs): Promise { - const bounds = this.maps[_args.id].map.getBounds(); - - if (bounds !== undefined) { - this.maps[_args.id].map.fitBounds(bounds, _args.padding); - } - } - - async getMapBounds(_args: { id: string }): Promise { - const bounds = this.maps[_args.id].map.getBounds(); - - if (!bounds) { - throw new Error('Google Map Bounds could not be found.'); - } - - return new LatLngBounds({ - southwest: { - lat: bounds.getSouthWest().lat(), - lng: bounds.getSouthWest().lng(), - }, - center: { - lat: bounds.getCenter().lat(), - lng: bounds.getCenter().lng(), - }, - northeast: { - lat: bounds.getNorthEast().lat(), - lng: bounds.getNorthEast().lng(), - }, - }); - } - - async fitBounds(_args: FitBoundsArgs): Promise { - const map = this.maps[_args.id].map; - const bounds = this.getLatLngBounds(_args.bounds); - map.fitBounds(bounds, _args.padding); - } - - async addMarkers(_args: AddMarkersArgs): Promise<{ ids: string[] }> { - const markerIds: string[] = []; - const map = this.maps[_args.id]; - - for (const markerArgs of _args.markers) { - const markerOpts = this.buildMarkerOpts(markerArgs, map.map); - const marker = new google.maps.Marker(markerOpts); - - const id = '' + this.currMarkerId; - - map.markers[id] = marker; - this.setMarkerListeners(_args.id, id, marker); - - markerIds.push(id); - this.currMarkerId++; - } - - return { ids: markerIds }; - } - - async addMarker(_args: AddMarkerArgs): Promise<{ id: string }> { - const markerOpts = this.buildMarkerOpts( - _args.marker, - this.maps[_args.id].map, - ); - - const marker = new google.maps.Marker(markerOpts); - - const id = '' + this.currMarkerId; - - this.maps[_args.id].markers[id] = marker; - this.setMarkerListeners(_args.id, id, marker); - - this.currMarkerId++; - - return { id: id }; - } - - async removeMarkers(_args: RemoveMarkersArgs): Promise { - const map = this.maps[_args.id]; - - for (const id of _args.markerIds) { - map.markers[id].setMap(null); - delete map.markers[id]; - } - } - - async removeMarker(_args: RemoveMarkerArgs): Promise { - this.maps[_args.id].markers[_args.markerId].setMap(null); - delete this.maps[_args.id].markers[_args.markerId]; - } - - async addPolygons(args: AddPolygonsArgs): Promise<{ ids: string[] }> { - const polygonIds: string[] = []; - const map = this.maps[args.id]; - - for (const polygonArgs of args.polygons) { - const polygon = new google.maps.Polygon(polygonArgs); - polygon.setMap(map.map); - - const id = '' + this.currPolygonId; - this.maps[args.id].polygons[id] = polygon; - this.setPolygonListeners(args.id, id, polygon); - - polygonIds.push(id); - this.currPolygonId++; - } - - return { ids: polygonIds }; - } - - async removePolygons(args: RemovePolygonsArgs): Promise { - const map = this.maps[args.id]; - - for (const id of args.polygonIds) { - map.polygons[id].setMap(null); - delete map.polygons[id]; - } - } - - async addCircles(args: AddCirclesArgs): Promise<{ ids: string[] }> { - const circleIds: string[] = []; - const map = this.maps[args.id]; - - for (const circleArgs of args.circles) { - const circle = new google.maps.Circle(circleArgs); - circle.setMap(map.map); - - const id = '' + this.currCircleId; - this.maps[args.id].circles[id] = circle; - this.setCircleListeners(args.id, id, circle); - - circleIds.push(id); - this.currCircleId++; - } - - return { ids: circleIds }; - } - - async removeCircles(args: RemoveCirclesArgs): Promise { - const map = this.maps[args.id]; - - for (const id of args.circleIds) { - map.circles[id].setMap(null); - delete map.circles[id]; - } - } - - async addPolylines(args: AddPolylinesArgs): Promise<{ ids: string[] }> { - const lineIds: string[] = []; - const map = this.maps[args.id]; - - for (const polylineArgs of args.polylines) { - const polyline = new google.maps.Polyline(polylineArgs); - polyline.set('tag', polylineArgs.tag); - polyline.setMap(map.map); - - const id = '' + this.currPolylineId; - this.maps[args.id].polylines[id] = polyline; - this.setPolylineListeners(args.id, id, polyline); - - lineIds.push(id); - this.currPolylineId++; - } - - return { - ids: lineIds, - }; - } - - async removePolylines(args: RemovePolylinesArgs): Promise { - const map = this.maps[args.id]; - - for (const id of args.polylineIds) { - map.polylines[id].setMap(null); - delete map.polylines[id]; - } - } - - async enableClustering(_args: EnableClusteringArgs): Promise { - const markers: google.maps.Marker[] = []; - - for (const id in this.maps[_args.id].markers) { - markers.push(this.maps[_args.id].markers[id]); - } - - this.maps[_args.id].markerClusterer = new MarkerClusterer({ - map: this.maps[_args.id].map, - markers: markers, - algorithm: new SuperClusterAlgorithm({ - minPoints: _args.minClusterSize ?? 4, - }), - onClusterClick: this.onClusterClickHandler, - }); - } - - async disableClustering(_args: { id: string }): Promise { - this.maps[_args.id].markerClusterer?.setMap(null); - this.maps[_args.id].markerClusterer = undefined; - } - - async onScroll(): Promise { - throw new Error('Method not supported on web.'); - } - - async onResize(): Promise { - throw new Error('Method not supported on web.'); - } - - async onDisplay(): Promise { - throw new Error('Method not supported on web.'); - } - - async create(_args: CreateMapArgs): Promise { - console.log(`Create map: ${_args.id}`); - await this.importGoogleLib(_args.apiKey, _args.region, _args.language); - - this.maps[_args.id] = { - map: new window.google.maps.Map(_args.element, { ..._args.config }), - element: _args.element, - markers: {}, - polygons: {}, - circles: {}, - polylines: {}, - }; - this.setMapListeners(_args.id); - } - - async destroy(_args: DestroyMapArgs): Promise { - console.log(`Destroy map: ${_args.id}`); - const mapItem = this.maps[_args.id]; - mapItem.element.innerHTML = ''; - mapItem.map.unbindAll(); - delete this.maps[_args.id]; - } - - async mapBoundsContains( - _args: MapBoundsContainsArgs, - ): Promise<{ contains: boolean }> { - const bounds = this.getLatLngBounds(_args.bounds); - const point = new google.maps.LatLng(_args.point.lat, _args.point.lng); - return { contains: bounds.contains(point) }; - } - - async mapBoundsExtend( - _args: MapBoundsExtendArgs, - ): Promise<{ bounds: LatLngBounds }> { - const bounds = this.getLatLngBounds(_args.bounds); - const point = new google.maps.LatLng(_args.point.lat, _args.point.lng); - bounds.extend(point); - const result = new LatLngBounds({ - southwest: { - lat: bounds.getSouthWest().lat(), - lng: bounds.getSouthWest().lng(), - }, - center: { - lat: bounds.getCenter().lat(), - lng: bounds.getCenter().lng(), - }, - northeast: { - lat: bounds.getNorthEast().lat(), - lng: bounds.getNorthEast().lng(), - }, - }); - return { bounds: result }; - } - - private getLatLngBounds(_args: LatLngBounds): google.maps.LatLngBounds { - return new google.maps.LatLngBounds( - new google.maps.LatLng(_args.southwest.lat, _args.southwest.lng), - new google.maps.LatLng(_args.northeast.lat, _args.northeast.lng), - ); - } - - async setCircleListeners( - mapId: string, - circleId: string, - circle: google.maps.Circle, - ): Promise { - circle.addListener('click', () => { - this.notifyListeners('onCircleClick', { - mapId: mapId, - circleId: circleId, - tag: circle.get('tag'), - }); - }); - } - - async setPolygonListeners( - mapId: string, - polygonId: string, - polygon: google.maps.Polygon, - ): Promise { - polygon.addListener('click', () => { - this.notifyListeners('onPolygonClick', { - mapId: mapId, - polygonId: polygonId, - tag: polygon.get('tag'), - }); - }); - } - - async setPolylineListeners( - mapId: string, - polylineId: string, - polyline: google.maps.Polyline, - ): Promise { - polyline.addListener('click', () => { - this.notifyListeners('onPolylineClick', { - mapId: mapId, - polylineId: polylineId, - tag: polyline.get('tag'), - }); - }); - } - - async setMarkerListeners( - mapId: string, - markerId: string, - marker: google.maps.Marker, - ): Promise { - marker.addListener('click', () => { - this.notifyListeners('onMarkerClick', { - mapId: mapId, - markerId: markerId, - latitude: marker.getPosition()?.lat(), - longitude: marker.getPosition()?.lng(), - title: marker.getTitle(), - snippet: '', - }); - }); - - marker.addListener('dragstart', () => { - this.notifyListeners('onMarkerDragStart', { - mapId: mapId, - markerId: markerId, - latitude: marker.getPosition()?.lat(), - longitude: marker.getPosition()?.lng(), - title: marker.getTitle(), - snippet: '', - }); - }); - - marker.addListener('drag', () => { - this.notifyListeners('onMarkerDrag', { - mapId: mapId, - markerId: markerId, - latitude: marker.getPosition()?.lat(), - longitude: marker.getPosition()?.lng(), - title: marker.getTitle(), - snippet: '', - }); - }); - - marker.addListener('dragend', () => { - this.notifyListeners('onMarkerDragEnd', { - mapId: mapId, - markerId: markerId, - latitude: marker.getPosition()?.lat(), - longitude: marker.getPosition()?.lng(), - title: marker.getTitle(), - snippet: '', - }); - }); - } - - async setMapListeners(mapId: string): Promise { - const map = this.maps[mapId].map; - - map.addListener('idle', async () => { - const bounds = await this.getMapBounds({ id: mapId }); - this.notifyListeners('onCameraIdle', { - mapId: mapId, - bearing: map.getHeading(), - bounds: bounds, - latitude: map.getCenter()?.lat(), - longitude: map.getCenter()?.lng(), - tilt: map.getTilt(), - zoom: map.getZoom(), - }); - }); - - map.addListener('center_changed', () => { - this.notifyListeners('onCameraMoveStarted', { - mapId: mapId, - isGesture: true, - }); - }); - - map.addListener('bounds_changed', async () => { - const bounds = await this.getMapBounds({ id: mapId }); - this.notifyListeners('onBoundsChanged', { - mapId: mapId, - bearing: map.getHeading(), - bounds: bounds, - latitude: map.getCenter()?.lat(), - longitude: map.getCenter()?.lng(), - tilt: map.getTilt(), - zoom: map.getZoom(), - }); - }); - - map.addListener( - 'click', - (e: google.maps.MapMouseEvent | google.maps.IconMouseEvent) => { - this.notifyListeners('onMapClick', { - mapId: mapId, - latitude: e.latLng?.lat(), - longitude: e.latLng?.lng(), - }); - }, - ); - - this.notifyListeners('onMapReady', { - mapId: mapId, - }); - } - - private buildMarkerOpts( - marker: Marker, - map: google.maps.Map, - ): google.maps.MarkerOptions { - let iconImage: google.maps.Icon | undefined = undefined; - if (marker.iconUrl) { - iconImage = { - url: marker.iconUrl, - scaledSize: marker.iconSize - ? new google.maps.Size(marker.iconSize.width, marker.iconSize.height) - : null, - anchor: marker.iconAnchor - ? new google.maps.Point(marker.iconAnchor.x, marker.iconAnchor.y) - : new google.maps.Point(0, 0), - origin: marker.iconOrigin - ? new google.maps.Point(marker.iconOrigin.x, marker.iconOrigin.y) - : new google.maps.Point(0, 0), - }; - } - - const opts: google.maps.MarkerOptions = { - position: marker.coordinate, - map: map, - opacity: marker.opacity, - title: marker.title, - icon: iconImage, - draggable: marker.draggable, - zIndex: marker.zIndex ?? 0, - }; - - return opts; - } -} diff --git a/google-maps/swiftlint.config.js b/google-maps/swiftlint.config.js deleted file mode 100644 index 3a7ec6de2..000000000 --- a/google-maps/swiftlint.config.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable no-undef */ -module.exports = { - // eslint-disable-next-line no-template-curly-in-string - included: ['${PWD}/ios/Plugin'], - identifier_name: { - min_length: { - warning: 3, - error: 1, - }, - }, - excluded: ['node_modules', 'ios/Pods'], - opt_in_rules: [ - 'implicitly_unwrapped_optional', - 'file_name_no_space', - 'force_unwrapping', - 'function_default_parameter_at_end', - 'lower_acl_than_parent', - 'modifier_order', - 'overridden_super_call', - 'unowned_variable_capture', - 'unused_import', - ], - line_length: { - warning: 150, - error: 300, - ignores_function_declarations: true, - ignores_comments: true, - ignores_interpolated_strings: true, - ignores_urls: true, - }, -}; diff --git a/google-maps/tsconfig.json b/google-maps/tsconfig.json deleted file mode 100644 index b2cbfd6c3..000000000 --- a/google-maps/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "allowUnreachableCode": false, - "declaration": true, - "declarationDir": "dist/typings", - "esModuleInterop": true, - "inlineSources": true, - "lib": ["dom", "es2017"], - "module": "esnext", - "moduleResolution": "node", - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "outDir": "dist/esm", - "pretty": true, - "sourceMap": true, - "strict": true, - "target": "es2017" - }, - "files": ["src/index.ts"] -} diff --git a/google-maps/unit-tests/android/.gitignore b/google-maps/unit-tests/android/.gitignore deleted file mode 100644 index aa724b770..000000000 --- a/google-maps/unit-tests/android/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -.cxx -local.properties diff --git a/google-maps/unit-tests/android/app/build.gradle b/google-maps/unit-tests/android/app/build.gradle deleted file mode 100644 index 551211168..000000000 --- a/google-maps/unit-tests/android/app/build.gradle +++ /dev/null @@ -1,58 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' -} - -android { - compileSdkVersion 31 - buildToolsVersion "30.0.3" - - defaultConfig { - applicationId "io.ionic.googlemapstest" - minSdkVersion 22 - targetSdkVersion 31 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.ext.junit.runners.AndroidJUnit4" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } - sourceSets { - main.java.srcDirs += '../../../android' - } - testOptions { - unitTests { - includeAndroidResources = true - } - unitTests.all { - testLogging { - events "passed", "skipped", "failed", "standardOut", "standardError" - outputs.upToDateWhen {false} - showStandardStreams = false - } - } - } -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" - implementation 'androidx.core:core-ktx:1.7.0' - implementation 'androidx.appcompat:appcompat:1.4.0' - implementation 'com.google.android.material:material:1.4.0' - implementation 'junit:junit:4.13.2' - testImplementation 'org.robolectric:robolectric:4.7.1' - implementation project(':capacitor-android') -} \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/proguard-rules.pro b/google-maps/unit-tests/android/app/proguard-rules.pro deleted file mode 100644 index 481bb4348..000000000 --- a/google-maps/unit-tests/android/app/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/src/main/AndroidManifest.xml b/google-maps/unit-tests/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index b8e985a0a..000000000 --- a/google-maps/unit-tests/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/src/main/java/io/ionic/googlemapstest/MainActivity.kt b/google-maps/unit-tests/android/app/src/main/java/io/ionic/googlemapstest/MainActivity.kt deleted file mode 100644 index c01c3d7d1..000000000 --- a/google-maps/unit-tests/android/app/src/main/java/io/ionic/googlemapstest/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package io.ionic.googlemapstest - -import androidx.appcompat.app.AppCompatActivity - -class MainActivity : AppCompatActivity() { -} \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/google-maps/unit-tests/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 2b068d114..000000000 --- a/google-maps/unit-tests/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/src/main/res/drawable/ic_launcher_background.xml b/google-maps/unit-tests/android/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index 07d5da9cb..000000000 --- a/google-maps/unit-tests/android/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/google-maps/unit-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index eca70cfe5..000000000 --- a/google-maps/unit-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/google-maps/unit-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index eca70cfe5..000000000 --- a/google-maps/unit-tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/google-maps/unit-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index a571e6009..000000000 Binary files a/google-maps/unit-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/google-maps/unit-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index 61da551c5..000000000 Binary files a/google-maps/unit-tests/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/google-maps/unit-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index c41dd2853..000000000 Binary files a/google-maps/unit-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/google-maps/unit-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index db5080a75..000000000 Binary files a/google-maps/unit-tests/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/google-maps/unit-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 6dba46dab..000000000 Binary files a/google-maps/unit-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/google-maps/unit-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index da31a871c..000000000 Binary files a/google-maps/unit-tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/google-maps/unit-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 15ac68172..000000000 Binary files a/google-maps/unit-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/google-maps/unit-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index b216f2d31..000000000 Binary files a/google-maps/unit-tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/google-maps/unit-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index f25a41974..000000000 Binary files a/google-maps/unit-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/google-maps/unit-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/google-maps/unit-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index e96783ccc..000000000 Binary files a/google-maps/unit-tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/google-maps/unit-tests/android/app/src/main/res/values-night/themes.xml b/google-maps/unit-tests/android/app/src/main/res/values-night/themes.xml deleted file mode 100644 index edf82468d..000000000 --- a/google-maps/unit-tests/android/app/src/main/res/values-night/themes.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/src/main/res/values/colors.xml b/google-maps/unit-tests/android/app/src/main/res/values/colors.xml deleted file mode 100644 index f8c6127d3..000000000 --- a/google-maps/unit-tests/android/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - #FFBB86FC - #FF6200EE - #FF3700B3 - #FF03DAC5 - #FF018786 - #FF000000 - #FFFFFFFF - \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/src/main/res/values/strings.xml b/google-maps/unit-tests/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 0a680a455..000000000 --- a/google-maps/unit-tests/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Google Maps Test - \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/src/main/res/values/themes.xml b/google-maps/unit-tests/android/app/src/main/res/values/themes.xml deleted file mode 100644 index 9e61c2624..000000000 --- a/google-maps/unit-tests/android/app/src/main/res/values/themes.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/google-maps/unit-tests/android/app/src/test/java/io/ionic/googlemapstest/GoogleMapsUnitTests.kt b/google-maps/unit-tests/android/app/src/test/java/io/ionic/googlemapstest/GoogleMapsUnitTests.kt deleted file mode 100644 index 1eee5112d..000000000 --- a/google-maps/unit-tests/android/app/src/test/java/io/ionic/googlemapstest/GoogleMapsUnitTests.kt +++ /dev/null @@ -1,18 +0,0 @@ -package io.ionic.googlemapstest - -import com.capacitorjs.plugins.googlemaps.CapacitorGoogleMaps -import org.junit.Assert.assertEquals -import org.junit.Test -import org.junit.runner.RunWith -import org.robolectric.RobolectricTestRunner - -@RunWith(RobolectricTestRunner::class) -class GoogleMapsUnitTests { - @Test - fun exampleTest() { - val plugin = CapacitorGoogleMaps() - - val valueOf = plugin.echo("Hello world!") - assertEquals("Hello world!", valueOf) - } -} \ No newline at end of file diff --git a/google-maps/unit-tests/android/build.gradle b/google-maps/unit-tests/android/build.gradle deleted file mode 100644 index 15609a9fe..000000000 --- a/google-maps/unit-tests/android/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - ext.kotlin_version = '1.6.0' - repositories { - google() - mavenCentral() - } - dependencies { - classpath "com.android.tools.build:gradle:4.2.2" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/google-maps/unit-tests/android/gradle.properties b/google-maps/unit-tests/android/gradle.properties deleted file mode 100644 index 252175276..000000000 --- a/google-maps/unit-tests/android/gradle.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Project-wide Gradle settings. -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true -# AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app"s APK -# https://developer.android.com/topic/libraries/support-library/androidx-rn -android.useAndroidX=true -# Kotlin code style for this project: "official" or "obsolete": -kotlin.code.style=official \ No newline at end of file diff --git a/google-maps/unit-tests/android/gradle/wrapper/gradle-wrapper.jar b/google-maps/unit-tests/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index f6b961fd5..000000000 Binary files a/google-maps/unit-tests/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/google-maps/unit-tests/android/gradle/wrapper/gradle-wrapper.properties b/google-maps/unit-tests/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 734c61290..000000000 --- a/google-maps/unit-tests/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Nov 19 08:06:49 PST 2021 -distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip -distributionPath=wrapper/dists -zipStorePath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME diff --git a/google-maps/unit-tests/android/gradlew b/google-maps/unit-tests/android/gradlew deleted file mode 100755 index cccdd3d51..000000000 --- a/google-maps/unit-tests/android/gradlew +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/google-maps/unit-tests/android/gradlew.bat b/google-maps/unit-tests/android/gradlew.bat deleted file mode 100644 index e95643d6a..000000000 --- a/google-maps/unit-tests/android/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/google-maps/unit-tests/android/settings.gradle b/google-maps/unit-tests/android/settings.gradle deleted file mode 100644 index 07da0dbf5..000000000 --- a/google-maps/unit-tests/android/settings.gradle +++ /dev/null @@ -1,4 +0,0 @@ -rootProject.name = "Google Maps Test" -include ':app' -include ':capacitor-android' -project(':capacitor-android').projectDir = new File('../../node_modules/@capacitor/android/capacitor') diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPlugin.xcodeproj/project.pbxproj b/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPlugin.xcodeproj/project.pbxproj deleted file mode 100644 index 96482c9e0..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPlugin.xcodeproj/project.pbxproj +++ /dev/null @@ -1,637 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 55; - objects = { - -/* Begin PBXBuildFile section */ - 022B20922746AD38000F2A2C /* GoogleMapsPlugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 022B20892746AD37000F2A2C /* GoogleMapsPlugin.framework */; }; - 022B20972746AD38000F2A2C /* GoogleMapsPluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 022B20962746AD38000F2A2C /* GoogleMapsPluginTests.swift */; }; - 022B20B02746ADD7000F2A2C /* CapacitorGoogleMaps.swift in Sources */ = {isa = PBXBuildFile; fileRef = 022B20A62746ADD7000F2A2C /* CapacitorGoogleMaps.swift */; }; - 022B20BC2746B791000F2A2C /* TestAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 022B20BB2746B791000F2A2C /* TestAppApp.swift */; }; - 022B20BE2746B791000F2A2C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 022B20BD2746B791000F2A2C /* ContentView.swift */; }; - 022B20C02746B793000F2A2C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 022B20BF2746B793000F2A2C /* Assets.xcassets */; }; - 022B20C32746B793000F2A2C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 022B20C22746B793000F2A2C /* Preview Assets.xcassets */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 022B20932746AD38000F2A2C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 022B20802746AD37000F2A2C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 022B20882746AD37000F2A2C; - remoteInfo = IdentityVaultNative; - }; - 022B20C82746B7FA000F2A2C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 022B20802746AD37000F2A2C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 022B20B82746B791000F2A2C; - remoteInfo = TestApp; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 022B20892746AD37000F2A2C /* GoogleMapsPlugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GoogleMapsPlugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 022B20912746AD38000F2A2C /* GoogleMapsPluginTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GoogleMapsPluginTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 022B20962746AD38000F2A2C /* GoogleMapsPluginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoogleMapsPluginTests.swift; sourceTree = ""; }; - 022B20A62746ADD7000F2A2C /* CapacitorGoogleMaps.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CapacitorGoogleMaps.swift; sourceTree = ""; }; - 022B20B92746B791000F2A2C /* TestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 022B20BB2746B791000F2A2C /* TestAppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestAppApp.swift; sourceTree = ""; }; - 022B20BD2746B791000F2A2C /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - 022B20BF2746B793000F2A2C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 022B20C22746B793000F2A2C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - 022B20C72746B7B1000F2A2C /* TestApp.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TestApp.entitlements; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 022B20862746AD37000F2A2C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 022B208E2746AD38000F2A2C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 022B20922746AD38000F2A2C /* GoogleMapsPlugin.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 022B20B62746B791000F2A2C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 022B207F2746AD37000F2A2C = { - isa = PBXGroup; - children = ( - 022B208B2746AD37000F2A2C /* GoogleMapsPlugin */, - 022B20952746AD38000F2A2C /* GoogleMapsPluginTests */, - 022B20BA2746B791000F2A2C /* TestApp */, - 022B208A2746AD37000F2A2C /* Products */, - ); - sourceTree = ""; - }; - 022B208A2746AD37000F2A2C /* Products */ = { - isa = PBXGroup; - children = ( - 022B20892746AD37000F2A2C /* GoogleMapsPlugin.framework */, - 022B20912746AD38000F2A2C /* GoogleMapsPluginTests.xctest */, - 022B20B92746B791000F2A2C /* TestApp.app */, - ); - name = Products; - sourceTree = ""; - }; - 022B208B2746AD37000F2A2C /* GoogleMapsPlugin */ = { - isa = PBXGroup; - children = ( - 022B20A62746ADD7000F2A2C /* CapacitorGoogleMaps.swift */, - ); - name = GoogleMapsPlugin; - path = ../../../ios/Plugin; - sourceTree = ""; - }; - 022B20952746AD38000F2A2C /* GoogleMapsPluginTests */ = { - isa = PBXGroup; - children = ( - 022B20962746AD38000F2A2C /* GoogleMapsPluginTests.swift */, - ); - path = GoogleMapsPluginTests; - sourceTree = ""; - }; - 022B20BA2746B791000F2A2C /* TestApp */ = { - isa = PBXGroup; - children = ( - 022B20C72746B7B1000F2A2C /* TestApp.entitlements */, - 022B20BB2746B791000F2A2C /* TestAppApp.swift */, - 022B20BD2746B791000F2A2C /* ContentView.swift */, - 022B20BF2746B793000F2A2C /* Assets.xcassets */, - 022B20C12746B793000F2A2C /* Preview Content */, - ); - path = TestApp; - sourceTree = ""; - }; - 022B20C12746B793000F2A2C /* Preview Content */ = { - isa = PBXGroup; - children = ( - 022B20C22746B793000F2A2C /* Preview Assets.xcassets */, - ); - path = "Preview Content"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 022B20842746AD37000F2A2C /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 022B20882746AD37000F2A2C /* GoogleMapsPlugin */ = { - isa = PBXNativeTarget; - buildConfigurationList = 022B209B2746AD38000F2A2C /* Build configuration list for PBXNativeTarget "GoogleMapsPlugin" */; - buildPhases = ( - 022B20842746AD37000F2A2C /* Headers */, - 022B20852746AD37000F2A2C /* Sources */, - 022B20862746AD37000F2A2C /* Frameworks */, - 022B20872746AD37000F2A2C /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = GoogleMapsPlugin; - productName = IdentityVaultNative; - productReference = 022B20892746AD37000F2A2C /* GoogleMapsPlugin.framework */; - productType = "com.apple.product-type.framework"; - }; - 022B20902746AD38000F2A2C /* GoogleMapsPluginTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 022B209E2746AD38000F2A2C /* Build configuration list for PBXNativeTarget "GoogleMapsPluginTests" */; - buildPhases = ( - 022B208D2746AD38000F2A2C /* Sources */, - 022B208E2746AD38000F2A2C /* Frameworks */, - 022B208F2746AD38000F2A2C /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 022B20942746AD38000F2A2C /* PBXTargetDependency */, - 022B20C92746B7FA000F2A2C /* PBXTargetDependency */, - ); - name = GoogleMapsPluginTests; - productName = IdentityVaultNativeTests; - productReference = 022B20912746AD38000F2A2C /* GoogleMapsPluginTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 022B20B82746B791000F2A2C /* TestApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = 022B20C42746B793000F2A2C /* Build configuration list for PBXNativeTarget "TestApp" */; - buildPhases = ( - 022B20B52746B791000F2A2C /* Sources */, - 022B20B62746B791000F2A2C /* Frameworks */, - 022B20B72746B791000F2A2C /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TestApp; - productName = TestApp; - productReference = 022B20B92746B791000F2A2C /* TestApp.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 022B20802746AD37000F2A2C /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1310; - LastUpgradeCheck = 1310; - TargetAttributes = { - 022B20882746AD37000F2A2C = { - CreatedOnToolsVersion = 13.1; - LastSwiftMigration = 1310; - }; - 022B20902746AD38000F2A2C = { - CreatedOnToolsVersion = 13.1; - TestTargetID = 022B20B82746B791000F2A2C; - }; - 022B20B82746B791000F2A2C = { - CreatedOnToolsVersion = 13.1; - }; - }; - }; - buildConfigurationList = 022B20832746AD37000F2A2C /* Build configuration list for PBXProject "GoogleMapsPlugin" */; - compatibilityVersion = "Xcode 13.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 022B207F2746AD37000F2A2C; - productRefGroup = 022B208A2746AD37000F2A2C /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 022B20882746AD37000F2A2C /* GoogleMapsPlugin */, - 022B20902746AD38000F2A2C /* GoogleMapsPluginTests */, - 022B20B82746B791000F2A2C /* TestApp */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 022B20872746AD37000F2A2C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 022B208F2746AD38000F2A2C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 022B20B72746B791000F2A2C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 022B20C32746B793000F2A2C /* Preview Assets.xcassets in Resources */, - 022B20C02746B793000F2A2C /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 022B20852746AD37000F2A2C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 022B20B02746ADD7000F2A2C /* CapacitorGoogleMaps.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 022B208D2746AD38000F2A2C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 022B20972746AD38000F2A2C /* GoogleMapsPluginTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 022B20B52746B791000F2A2C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 022B20BE2746B791000F2A2C /* ContentView.swift in Sources */, - 022B20BC2746B791000F2A2C /* TestAppApp.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 022B20942746AD38000F2A2C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 022B20882746AD37000F2A2C /* GoogleMapsPlugin */; - targetProxy = 022B20932746AD38000F2A2C /* PBXContainerItemProxy */; - }; - 022B20C92746B7FA000F2A2C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 022B20B82746B791000F2A2C /* TestApp */; - targetProxy = 022B20C82746B7FA000F2A2C /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 022B20992746AD38000F2A2C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 022B209A2746AD38000F2A2C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 022B209C2746AD38000F2A2C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = io.ionic.GoogleMapsPlugin; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 022B209D2746AD38000F2A2C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = io.ionic.GoogleMapsPlugin; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 022B209F2746AD38000F2A2C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = io.ionic.IdentityVaultNativeTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestApp.app/TestApp"; - }; - name = Debug; - }; - 022B20A02746AD38000F2A2C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = io.ionic.IdentityVaultNativeTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestApp.app/TestApp"; - }; - name = Release; - }; - 022B20C52746B793000F2A2C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = TestApp/TestApp.entitlements; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"TestApp/Preview Content\""; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = io.ionic.TestApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 022B20C62746B793000F2A2C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = TestApp/TestApp.entitlements; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"TestApp/Preview Content\""; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = io.ionic.TestApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 022B20832746AD37000F2A2C /* Build configuration list for PBXProject "GoogleMapsPlugin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 022B20992746AD38000F2A2C /* Debug */, - 022B209A2746AD38000F2A2C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 022B209B2746AD38000F2A2C /* Build configuration list for PBXNativeTarget "GoogleMapsPlugin" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 022B209C2746AD38000F2A2C /* Debug */, - 022B209D2746AD38000F2A2C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 022B209E2746AD38000F2A2C /* Build configuration list for PBXNativeTarget "GoogleMapsPluginTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 022B209F2746AD38000F2A2C /* Debug */, - 022B20A02746AD38000F2A2C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 022B20C42746B793000F2A2C /* Build configuration list for PBXNativeTarget "TestApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 022B20C52746B793000F2A2C /* Debug */, - 022B20C62746B793000F2A2C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 022B20802746AD37000F2A2C /* Project object */; -} diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 989f75d9c..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPluginTests/GoogleMapsPluginTests.swift b/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPluginTests/GoogleMapsPluginTests.swift deleted file mode 100644 index 034c8d71d..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/GoogleMapsPluginTests/GoogleMapsPluginTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -import XCTest -@testable import GoogleMapsPlugin - -class GoogleMapsPluginTests: XCTestCase { - var plugin: CapacitorGoogleMaps? - - override func setUpWithError() throws { - self.plugin = CapacitorGoogleMaps() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func exampleTest() throws { - do { - if let plugin = self.plugin { - let value = try plugin.echo("Hello world!") - - XCTAssertEqual("Hello world!", value) - } - } catch { - print("Example Test Error \(error)") - XCTFail() - } - } - - func testPerformanceExample() throws { - // This is an example of a performance test case. - self.measure { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Assets.xcassets/AccentColor.colorset/Contents.json b/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb8789700..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 9221b9bb1..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Assets.xcassets/Contents.json b/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596a..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/ContentView.swift b/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/ContentView.swift deleted file mode 100644 index 6b8aa078f..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/ContentView.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// ContentView.swift -// TestApp -// -// Created by Joseph Pender on 11/18/21. -// - -import SwiftUI - -struct ContentView: View { - var body: some View { - Text("Hello, world!") - .padding() - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView() - } -} diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Preview Content/Preview Assets.xcassets/Contents.json b/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596a..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/TestApp.entitlements b/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/TestApp.entitlements deleted file mode 100644 index 1c22eb380..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/TestApp.entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - keychain-access-groups - - $(AppIdentifierPrefix)io.ionic.TestApp - - - diff --git a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/TestAppApp.swift b/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/TestAppApp.swift deleted file mode 100644 index ecd3f3b8d..000000000 --- a/google-maps/unit-tests/ios/GoogleMapsPlugin/TestApp/TestAppApp.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// TestAppApp.swift -// TestApp -// -// Created by Joseph Pender on 11/18/21. -// - -import SwiftUI - -@main -struct TestAppApp: App { - var body: some Scene { - WindowGroup { - ContentView() - } - } -} diff --git a/nx.json b/nx.json index afae018f9..1cd870a28 100644 --- a/nx.json +++ b/nx.json @@ -22,7 +22,6 @@ "{projectRoot}/dialog/dist", "{projectRoot}/filesystem/dist", "{projectRoot}/geolocation/dist", - "{projectRoot}/google-maps/dist", "{projectRoot}/haptics/dist", "{projectRoot}/keyboard/dist", "{projectRoot}/local-notifications/dist", diff --git a/package.json b/package.json index b9ae0b136..8ecce4870 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,6 @@ "dialog", "filesystem", "geolocation", - "google-maps", "haptics", "keyboard", "local-notifications",