Fix: MarkerCluster: -----> This is remained cluster icon
MODIFY
README.md
README.md
-# Cordova GoogleMaps plugin for Android, iOS and Browser
+# Cordova GoogleMaps plugin for Android, iOS and Browser v2.5.1-beta
| Download | Build test (master branch)|
|----------|---------------------------|
-| [![](https://img.shields.io/npm/dm/cordova-plugin-googlemaps.svg)](https://npm-stat.com/charts.html?package=cordova-plugin-googlemaps) |[![](https://travis-ci.org/mapsplugin/cordova-plugin-googlemaps.svg?branch=master)](https://travis-ci.org/mapsplugin/cordova-plugin-googlemaps/branches) |
+| [![](https://img.shields.io/npm/dm/cordova-plugin-googlemaps.svg)](https://npm-stat.com/charts.html?package=cordova-plugin-googlemaps) |[![](https://travis-ci.org/mapsplugin/cordova-plugin-googlemaps.svg?branch=multiple_maps)](https://travis-ci.org/mapsplugin/cordova-plugin-googlemaps/branches) |
This plugin displays Google Maps in your application.
This plugin uses these libraries for each platforms:
---------------------------------------------------------------------------------------------------------
## Release Notes
+ - **v2.5.1**
+ - Fix: (Android/iOS/Browser) Marker cluster does not work when you zoom in.
+
- **v2.5.0**
- Add: (Android/iOS/Browser) Support `promise` for `TileOverlayOptions.getTile`. You must return new URL in 5 seconds.
```js
- Fix: (Android/iOS/Browser) `INFO_CLICK` does not work on marker cluster.
- Fix: (iOS) Can not click on HtmlInfoWindow.
- - **v2.4.6**
- - Fix: (iOS) Only `src/ios/check_sdk_version.js` error.
-
- - **v2.4.5**
- - Fix: (Browser) `GeocoderResult.extra.lines` field is incorrect position.
- - Fix: (Android/iOS/Browser) `promise-7.0.4.min.js.map` file is missing.
- - Update: (Android/iOS/Browser) Detecting way of `viewport-fit=cover`.
- - Update: (iOS) No longer use `com.googlemaps.ios`. Use `CocoaPod` installation instead.
-
- - **v2.4.4**
- - Fix: (Browser) All methods were tested, and fixed lots of bugs.
- - Fix: (Android/iOS) Executes `map.animateCamera()` while map has been detached automatically causes dead lock.
- - Update: (iOS) Fixed issue where plugin could appear behind other plugins
- - Update: (Android) `getMyLocation()` does not return if application has been launched when location is disabled, then enable the location after soon.
-
- - **v2.4.3**
- - Fix: (Browser) HTMLInfoWindow displays unnecessary scroll bars.
- - Fix: (Android) Can not load KML file from http://localhost on ionic 3.
- - Fix: (iOS) Can not click bottom 20px.
- - Fix: (Browser) map.setCameraTarget() implementation is wrong.
- - Fix: (iOS) GroundOverlayOptions.anchor property is missing.
- - Add: (Android/iOS/Browser) `GoogleMapOptions.preferences.gestureBounds` property. You can set limit bounds of panning.
- ```js
- var map = plugin.google.maps.Map.getMap(mapDiv, {
- 'preferences': {
- 'gestureBounds': [
- {lat: ..., lng: ...},
- ... ,
- {lat: ..., lng: ...}
- ]
- }
- });
- ```
-
- - **v2.4.2**
- - Fix: If application uses ionic v1, it can't interactive with map view on only iPhone5 because of resetCSS
- - Fix: `Cannot set property 'isMap' of undefined` error
- - Update: (Browser) Can not load Google Maps JavaScript API v3 with `libraries=places`
-
- - **v2.4.1**
- - Fix: `map.getMap()` does not work when page changing on ionic v4.
- - Fix: `LocationService.hasPermission()` is not implement for browser platform.
-
- - **v2.4.0**
- - Add: `Browser` platform!
- - Add: `plugin.google.maps.environment.setEnv()` method.
- - Add: `icon` property for KmlOverlayOptions
- - Fix: map.addKmlOverlay() does not work if page url contains '#hash'
-
---------------------------------------------------------------------------------------------------------
## Demos

MODIFY
package.json
package.json
{
"name": "cordova-plugin-googlemaps",
- "version": "2.5.0",
+ "version": "2.5.1-beta-20190205",
"description": "Google Maps native SDK for Android and iOS, and Google Maps JavaScript API v3 for browser.",
"cordova": {
"id": "cordova-plugin-googlemaps",

MODIFY
www/BaseClass.js
www/BaseClass.js
@@ -26,6 +26,7 @@ BaseClass.prototype = {
},
set: function (key, value, noNotify) {
+ if (key === "__pgmId") return;
var prev = this.get(key);
this[VARS_FIELD][key] = value;
@@ -38,6 +39,7 @@ BaseClass.prototype = {
},
bindTo: function (key, target, targetKey, noNotify) {
+ if (key === "__pgmId") return;
targetKey = targetKey || key;
// If `noNotify` is true, prevent `(targetKey)_changed` event occurrs,

MODIFY
www/MarkerCluster.js
www/MarkerCluster.js
+
/* eslint no-useless-escape: off */
var utils = require('cordova/utils'),
@@ -137,7 +138,7 @@ var MarkerCluster = function (map, markerClusterOptions, _exec) {
};
var marker = self._createMarker(markerOptions);
- var markerId = marker.__pgmId.split(/\-/)[1];
+ var markerId = marker.__pgmId;
self._markerMap[markerId] = marker;
if (skipRedraw || !self._isReady) {
return marker;
@@ -604,7 +605,7 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', {
while (self._clusters[self.OUT_OF_RESOLUTION].length > 0) {
marker = self._clusters[self.OUT_OF_RESOLUTION].shift();
marker.get('_cluster').isAdded = false;
- markerId = marker.__pgmId.split(/\-/)[1];
+ markerId = marker.__pgmId;
deleteClusters[markerId] = 1;
if (marker.__pgmId === activeMarkerId) {
@@ -665,7 +666,7 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', {
if (cluster.getMode() === cluster.NO_CLUSTER_MODE) {
cluster.getMarkers().forEach(function (marker) {
- var markerId = marker.__pgmId.split(/\-/)[1];
+ var markerId = marker.__pgmId;
deleteClusters[markerId] = 1;
marker.get('_cluster').isAdded = false;
if (self.debug) {
@@ -732,7 +733,7 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', {
self._stopRequest) {
return;
}
- var markerId = marker.__pgmId.split(/\-/)[1];
+ var markerId = marker.__pgmId;
marker.get('_cluster').isAdded = false;
//targetMarkers.push(markerOpts);
if (noClusterMode) {
@@ -768,7 +769,7 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', {
var noClusterMode = cluster.getMode() === cluster.NO_CLUSTER_MODE;
cluster.getMarkers().forEach(function (marker) {
marker.get('_cluster').isAdded = false;
- var markerId = marker.__pgmId.split(/\-/)[1];
+ var markerId = marker.__pgmId;
if (noClusterMode) {
if (self.debug) {
console.log('---> (js:614)delete:' + markerId);
@@ -966,7 +967,7 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', {
clusterOpts.isClusterIcon = true;
if (cluster.getMode() === cluster.NO_CLUSTER_MODE) {
cluster.getMarkers().forEach(function (marker) {
- var markerId = marker.__pgmId.split(/\-/)[1];
+ var markerId = marker.__pgmId;
deleteClusters[markerId] = 1;
if (self.debug) {
console.log('---> (js:800)delete:' + markerId);
@@ -1006,7 +1007,7 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', {
if (!marker.get('_cluster').isAdded) {
return;
}
- var markerId = marker.__pgmId.split(/\-/)[1];
+ var markerId = marker.__pgmId;
delete deleteClusters[markerId];
marker.get('_cluster').isClusterIcon = false;
if (self.debug) {
@@ -1026,7 +1027,7 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', {
if (marker.get('_cluster').isAdded) {
return;
}
- var markerId = marker.__pgmId.split(/\-/)[1];
+ var markerId = marker.__pgmId;
marker.get('_cluster').isClusterIcon = false;
if (self.debug) {
console.log('---> (js:859)add:' + markerId);
@@ -1089,8 +1090,8 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', {
'new_or_update': new_or_update_clusters,
'delete': delete_clusters
});
- */
}
+*/
});
MarkerCluster.prototype.getClusterIcon = function (cluster) {
@@ -1122,7 +1123,7 @@ MarkerCluster.prototype.getClusterIcon = function (cluster) {
MarkerCluster.prototype._createMarker = function (markerOpts) {
var self = this;
- var markerId = self.getId() + '-marker_' + Math.floor(Date.now() * Math.random());
+ var markerId = 'marker_' + Math.floor(Date.now() * Math.random());
var marker = new Marker(self.getMap(), markerOpts, exec, {
className: 'MarkerCluster',
__pgmId: markerId

Fix: MarkerCluster: -----> This is remained cluster icon (#2553)