Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InterruptedException to Exception change #2909

Open
wants to merge 7 commits into
base: multiple_maps
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 35 additions & 135 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)|
|----------|---------------------------|
Expand Down Expand Up @@ -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
<widget ...>

<!--
You need to specify cli-7.1.0 or greater version.
https://build.phonegap.com/current-support
-->
<preference name="phonegap-version" value="cli-8.1.1" />
</widget>
```

## Install optional variables

- ![](https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/icon-android.png) **PLAY_SERVICES_VERSION = (15.0.1)**<br>
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)**<br>
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**<br>
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**<br>
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
```

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
$> cordova plugin add cordova-plugin-googlemaps
```


### 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
<widget ...>
Expand All @@ -120,11 +50,7 @@
</widget>
```

### 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,
Expand All @@ -136,62 +62,44 @@
//
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.
var map = plugin.google.maps.Map.getMap(div);

```

### 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
<widget ...>

```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.
});
<!--
You need to specify cli-7.1.0 or greater version.
https://build.phonegap.com/current-support
-->
<preference name="phonegap-version" value="cli-8.1.1" />
</widget>
```
<img src="https://raw.githubusercontent.com/mapsplugin/cordova-plugin-googlemaps/master/images/development_mode.png" width="300">

### 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.

### Behavior differences

`Google Maps JavaScript API v3` is completely different ecosystem with `Google Maps Android API` and `Google Maps SDK for iOS`.
## Install optional variables (config.xml)

`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) **GOOGLE_MAPS_PLAY_SERVICES_VERSION = (16.0.1)**<br>
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)**<br>
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**<br>
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**<br>
This message is displayed when your application requests **LOCATION PERMISSION for always**.

---------------------------------------------------------------------------------------------------------

Expand All @@ -204,8 +112,13 @@
---------------------------------------------------------------------------------------------------------

## Release Notes

- **v2.7.1**
- Fix: (iOS) UiWebView references present in v2.7.0

- **v2.7.0**
- Re-adoption: <a href="https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk" target="_blank">cordova-plugin-googlemaps-sdk dependency</a>
- 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
Expand All @@ -225,22 +138,9 @@
- Remove promise-7.0.4-min.js.map
- Fix: (iOS) bug fix: App crashes if "bearing" property is "<null>"
- Fix: HTMLColor2RGBA() converts to incorrect value
- Fix: (Android) Can't load marker image from the Ineternet

- **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 `[email protected]` or above, otherwise modify `platform/ios/Podfile`.
- Add: (Android/iOS) API Key mechanism
- Fix: (Android) Can't load marker image from the Internet
- many bug fixes...


---------------------------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-googlemaps",
"version": "2.7.0-20200330-2338",
"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",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-googlemaps" version="2.7.0-20200330-2338" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<plugin id="cordova-plugin-googlemaps" version="2.7.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="Promise" src="www/Promise.js" />
<js-module name="BaseClass" src="www/BaseClass.js">
Expand Down
2 changes: 1 addition & 1 deletion src/android/plugin/google/maps/PluginMarker.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public void run() {
if (!_clearDone) {
semaphore.acquire();
}
} catch (InterruptedException ignore) {
} catch (Exception ignore) {

}
}
Expand Down