From 1e27920751a74fb015dc81618e78e369f3d5b1fa Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Mon, 30 Mar 2020 23:46:17 -0700 Subject: [PATCH 1/6] Ready for v2.7.0 --- README.md | 148 ++++++++++----------------------------------------- package.json | 2 +- plugin.xml | 2 +- 3 files changed, 31 insertions(+), 121 deletions(-) diff --git a/README.md b/README.md index 268f3fff3..37cb91e1a 100644 --- a/README.md +++ b/README.md @@ -37,81 +37,11 @@ ## Quick install - - *Stable version(npm)* - ``` - $> cordova plugin add cordova-plugin-googlemaps - ``` - - - *Development version(beta version)* - ``` - $> cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps - ``` - -## PhoneGap Build settings - - ```xml - - - - - - ``` - -## Install optional variables - - - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-android.png) **PLAY_SERVICES_VERSION = (15.0.1)**
- The Google Play Services SDK version. - _You need to specify the same version number with all other plugins._ - Check out the latest version [here](https://developers.google.com/android/guides/releases). - - - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-android.png) **ANDROID_SUPPORT_V4_VERSION = (27.1.1)**
- This plugin requires the Android support library v4. - _The minimum version is 24.1.0._ - Check out the latest version [here](https://developer.android.com/topic/libraries/support-library/revisions.html). - - - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-ios.png) **LOCATION_WHEN_IN_USE_DESCRIPTION**
- This message is displayed when your application requests **LOCATION PERMISSION for only necessary times**. - - - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-ios.png) **LOCATION_ALWAYS_USAGE_DESCRIPTION**
- This message is displayed when your application requests **LOCATION PERMISSION for always**. - ---------------------------------------------------------------------------------------------------------- - -## Browser platform - - We support browser platform now! - You can develop your application with browser, then run it! - At the end of development, you can upload the html files to your server, or run it on Android or iOS devices. - - ``` - $> cordova run browser ``` - - If you use [ionic framework](https://ionicframework.com/), it supports `live-reload`. - - ``` - $> ionic cordova run browser -l + $> cordova plugin add cordova-plugin-googlemaps ``` - If you want to use `live-reload`, but you don't want to use other framework or without framework, - [cordova-plugin-browsersync](https://www.npmjs.com/package/cordova-plugin-browsersync) is useful. - - ``` - $> cordova plugin add cordova-plugin-browsersync - - $> cordova run (browser/android/ios) -- --live-reload - ``` - - -### API key (Android and iOS platforms) - - As of v2.6.0, you need to specify your API keys in `config.xml` file instead of `--variable`. - This allows you to change your API keys for anytime without reinstallation. - - Please pay attention the variable names are changed. +Then set your Google Maps API keys into your `config.xml` (Android / iOS). ```xml @@ -120,11 +50,7 @@ ``` -### API key (Browser platform) - - In the browser platform, the maps plugin uses [Google Maps JavaScript API v3](https://developers.google.com/maps/documentation/javascript/) - - You need to set **two API keys for Google Maps JavaScript API v3**. +For browser platform, ```js // If your app runs this program on browser, @@ -136,7 +62,7 @@ // plugin.google.maps.environment.setEnv({ 'API_KEY_FOR_BROWSER_RELEASE': '(YOUR_API_KEY_IS_HERE)', - 'API_KEY_FOR_BROWSER_DEBUG': '' + 'API_KEY_FOR_BROWSER_DEBUG': '' // optional }); // Create a Google Maps native view under the map_canvas div. @@ -144,54 +70,36 @@ ``` -### Why **two API keys**? - - `JavaScript` code is `text code`. Even if you do obfuscation, it's still readable finally. - In order to protect your API key, you need to set `Key restriction` for these keys. - - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/api_key_restrictions.png) +## PhoneGap Build settings - If you don't set API key, the maps plugin still work with `development mode`. + ```xml + - ```js - plugin.google.maps.environment.setEnv({ - 'API_KEY_FOR_BROWSER_RELEASE': '(YOUR_API_KEY_IS_HERE)', - 'API_KEY_FOR_BROWSER_DEBUG': '' // If key is empty or unset, - // the maps plugin runs under the development mode. - }); + + + ``` - - -### Which browser supported? - - Modern browsers should work without any problem. - - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/modern_browsers.png) - Internet Explorer 11 might work. We don't confirm all features, but basic features work. +## Install optional variables (config.xml) -### Behavior differences - - `Google Maps JavaScript API v3` is completely different ecosystem with `Google Maps Android API` and `Google Maps SDK for iOS`. - - `Google Maps JavaScript API v3` : - - **can't** draw 3D building, - - **does't work** if offline, - - **can't** map rotation, - - etc... - - In the browser platform, the maps plugin works almost the same behaviors as native platforms(Android, and iOS), - but not exactly the same behaviors. - So don't expect too much. + - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-android.png) **PLAY_SERVICES_VERSION = (15.0.1)**
+ The Google Play Services SDK version. + _You need to specify the same version number with all other plugins._ + Check out the latest version [here](https://developers.google.com/android/guides/releases). -### Touch mechanism difference + - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-android.png) **ANDROID_SUPPORT_V4_VERSION = (27.1.1)**
+ This plugin requires the Android support library v4. + _The minimum version is 24.1.0._ + Check out the latest version [here](https://developer.android.com/topic/libraries/support-library/revisions.html). - As you may know, [this plugin displays native Google Maps view under the browser in Android and iOS](#how-does-this-plugin-work-android-ios). - However this plugin displays as `normal HTML element` in browser platform. + - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-ios.png) **LOCATION_WHEN_IN_USE_DESCRIPTION**
+ This message is displayed when your application requests **LOCATION PERMISSION for only necessary times**. - Because of this, touch behavior is different. - The maps plugin does not hook the touch position, do not set `background: transparent`, ... etc. - But if you use this plugin as normal behavior, you don't need to consider about this. + - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-ios.png) **LOCATION_ALWAYS_USAGE_DESCRIPTION**
+ This message is displayed when your application requests **LOCATION PERMISSION for always**. --------------------------------------------------------------------------------------------------------- @@ -206,6 +114,7 @@ ## Release Notes - **v2.7.0** - Re-adoption: cordova-plugin-googlemaps-sdk dependency + - Important update: No longer support `UIWebView` on iOS. `WKWebView` only. - Fix: (iOS) Can't load image files from local host on ionic 4 / 5 - Update: (Android) prevent null pointer error in AsyncLoadImage.java - Fix: Css animation interference when call setDiv and there is a push/pop page @@ -225,7 +134,8 @@ - Remove promise-7.0.4-min.js.map - Fix: (iOS) bug fix: App crashes if "bearing" property is "" - Fix: HTMLColor2RGBA() converts to incorrect value - - Fix: (Android) Can't load marker image from the Ineternet + - Fix: (Android) Can't load marker image from the Internet + - many bug fixes... - **v2.6.2** - Fix: (Android) build error diff --git a/package.json b/package.json index 6c03090e7..45044e755 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-googlemaps", - "version": "2.7.0-20200330-2338", + "version": "2.7.0", "description": "Google Maps native SDK for Android and iOS, and Google Maps JavaScript API v3 for browser.", "cordova": { "id": "cordova-plugin-googlemaps", diff --git a/plugin.xml b/plugin.xml index 4d0024f79..78c2c9c8d 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,5 +1,5 @@ - + cordova-plugin-googlemaps From d015687c2f959f4b82045dd22c0eff5ba90c5f75 Mon Sep 17 00:00:00 2001 From: wf9a5m75 Date: Thu, 9 Apr 2020 15:10:01 -0700 Subject: [PATCH 2/6] prepare for v2.7.1 --- README.md | 20 +++++--------------- package.json | 2 +- plugin.xml | 2 +- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 37cb91e1a..4d4d973ec 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Cordova GoogleMaps plugin for Android, iOS and Browser v2.7.0 +# Cordova GoogleMaps plugin for Android, iOS and Browser v2.7.1 | Download | Build test (multiple_maps branch)| |----------|---------------------------| @@ -112,6 +112,10 @@ For browser platform, --------------------------------------------------------------------------------------------------------- ## Release Notes + + - **v2.7.1** + - Fix: (iOS) UiWebView references present in v2.7.0 + - **v2.7.0** - Re-adoption: cordova-plugin-googlemaps-sdk dependency - Important update: No longer support `UIWebView` on iOS. `WKWebView` only. @@ -137,20 +141,6 @@ For browser platform, - Fix: (Android) Can't load marker image from the Internet - many bug fixes... - - **v2.6.2** - - Fix: (Android) build error - - - **v2.6.1** - - Fix: (Android) Conflicting with `OneSignal-Cordova-SDK` - - Fix: (iOS) App crashes when marker url isn't valid. - - - **v2.6.0** - - Fix: Can not install to Cordova 9.0 project - - Fix: (Android) `ConcurrentModificationException` error at `onStop` - - Fix: (Android) Polygon becomes visible when you run `setPoints()` to invisible polygon - - Fix: (Android/iOS) TileOverlay does not work when your app runs on `file:` protocol with ionic. - - Update: (iOS) Specify the Google Maps SDK version as `=> 3.1.0`. Please use `cordova-ios@5.0.0` or above, otherwise modify `platform/ios/Podfile`. - - Add: (Android/iOS) API Key mechanism --------------------------------------------------------------------------------------------------------- diff --git a/package.json b/package.json index 45044e755..bc6c54e48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-googlemaps", - "version": "2.7.0", + "version": "2.7.1", "description": "Google Maps native SDK for Android and iOS, and Google Maps JavaScript API v3 for browser.", "cordova": { "id": "cordova-plugin-googlemaps", diff --git a/plugin.xml b/plugin.xml index 78c2c9c8d..1a2c801c5 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,5 +1,5 @@ - + cordova-plugin-googlemaps From de0bee2d8bd2d3f6232741fbf84497a49435c408 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Fri, 22 May 2020 09:48:23 -0700 Subject: [PATCH 3/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d4d973ec..dd66aebfd 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ For browser platform, ## Install optional variables (config.xml) - - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-android.png) **PLAY_SERVICES_VERSION = (15.0.1)**
+ - ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-android.png) **GOOGLE_MAPS_PLAY_SERVICES_VERSION = (16.0.1)**
The Google Play Services SDK version. _You need to specify the same version number with all other plugins._ Check out the latest version [here](https://developers.google.com/android/guides/releases). From 420e90705c48c135aa3f8c0cc85b3ad7325c429e Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Mon, 17 Aug 2020 15:34:51 -0700 Subject: [PATCH 4/6] Prevent crash at onStop Probably the bug of the Google Maps SDK for Android v3 beta --- src/android/plugin/google/maps/PluginMap.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/android/plugin/google/maps/PluginMap.java b/src/android/plugin/google/maps/PluginMap.java index a3d379f0e..b4bde52e4 100644 --- a/src/android/plugin/google/maps/PluginMap.java +++ b/src/android/plugin/google/maps/PluginMap.java @@ -497,6 +497,11 @@ public void onCameraIdle() { }); } + /* + //*************************************************************************** + // Google Maps SDK for Android v3 beta causes crash for these processes. + // Tmporally commented out + //*************************************************************************** @Override public void onStart() { super.onStart(); @@ -531,6 +536,7 @@ public void onResume(boolean multitasking) { } //mapCtrl.mPluginLayout.addPluginOverlay(PluginMap.this); } + */ private class AdjustInitCamera implements Runnable { private JSONObject mParams; From bdb7af4730857a6b51662a8cfd180f6c5a3dce35 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Mon, 17 Aug 2020 15:35:52 -0700 Subject: [PATCH 5/6] Revert --- src/android/plugin/google/maps/PluginMap.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/android/plugin/google/maps/PluginMap.java b/src/android/plugin/google/maps/PluginMap.java index b4bde52e4..a3d379f0e 100644 --- a/src/android/plugin/google/maps/PluginMap.java +++ b/src/android/plugin/google/maps/PluginMap.java @@ -497,11 +497,6 @@ public void onCameraIdle() { }); } - /* - //*************************************************************************** - // Google Maps SDK for Android v3 beta causes crash for these processes. - // Tmporally commented out - //*************************************************************************** @Override public void onStart() { super.onStart(); @@ -536,7 +531,6 @@ public void onResume(boolean multitasking) { } //mapCtrl.mPluginLayout.addPluginOverlay(PluginMap.this); } - */ private class AdjustInitCamera implements Runnable { private JSONObject mParams; From fe62d4cc84f7abac912ce1cc55b8fb94034408c8 Mon Sep 17 00:00:00 2001 From: michal-szklarski-jmp <109214368+michal-szklarski-jmp@users.noreply.github.com> Date: Wed, 13 Jul 2022 14:34:08 +0200 Subject: [PATCH 6/6] InterruptedException to Exception change We're observing the enormous number of crashes (coming mostly from Firebase's stack trace) in PluginMarker.java file. The line 167 is generating an Exception that is not being predicted by the Try-Catch where is inserted (lines 149 - 185), which is specifically only catching InterruptedException types. Simply replacing "InterruptedException" with "Exception" will solve the problem, as then the catch will be able to catch all Exception types and avoid the crash. --- src/android/plugin/google/maps/PluginMarker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/plugin/google/maps/PluginMarker.java b/src/android/plugin/google/maps/PluginMarker.java index 0c9f6f7a8..c639532ce 100644 --- a/src/android/plugin/google/maps/PluginMarker.java +++ b/src/android/plugin/google/maps/PluginMarker.java @@ -182,7 +182,7 @@ public void run() { if (!_clearDone) { semaphore.acquire(); } - } catch (InterruptedException ignore) { + } catch (Exception ignore) { } }