From f9df07117f1841a6c909cf47ad14e052c76e0d06 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 28 Apr 2022 11:38:05 +0200 Subject: [PATCH 01/13] marker cluster sumatory of markers label --- www/MarkerCluster.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/www/MarkerCluster.js b/www/MarkerCluster.js index 0a6babdcd..38948d9b0 100644 --- a/www/MarkerCluster.js +++ b/www/MarkerCluster.js @@ -955,13 +955,24 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', { } unionedMarkers.forEach(function (cluster) { + var countCluster = 0; + cluster._markerArray.forEach(function (marker) { + var data = marker.get('data'); + if (data && data.data && data.data.operative == 'ECHARGE') { + countCluster = countCluster + data.data.label + } + }); + + if (countCluster == 0) { + countCluster = cluster.getItemLength(); + } var icon = self.getClusterIcon(cluster), clusterOpts = { - 'count': cluster.getItemLength(), + 'count': countCluster, 'position': cluster.getBounds().getCenter(), '__pgmId': cluster.getId() - }; + }; if (self.debug) { clusterOpts.geocell = cluster.geocell; From 3be43eeda8dcbbd45cfdb3168ab6cd0c2c247a31 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 28 Apr 2022 16:18:29 +0200 Subject: [PATCH 02/13] abstract method to get sumatory of cluster labels --- www/Map.js | 3 ++- www/MarkerCluster.js | 41 ++++++++++++++++++++++++++++++++--------- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/www/Map.js b/www/Map.js index f78aff908..d71a90ac1 100644 --- a/www/Map.js +++ b/www/Map.js @@ -1350,7 +1350,8 @@ Map.prototype.addMarkerCluster = function(markerClusterOptions, callback) { 'idxCount': positionList.length + 1, 'maxZoomLevel': Math.min(markerClusterOptions.maxZoomLevel || 15, 18), 'debug': markerClusterOptions.debug === true, - 'boundsDraw': common.defaultTrueOption(markerClusterOptions.boundsDraw) + 'boundsDraw': common.defaultTrueOption(markerClusterOptions.boundsDraw), + 'sumLabels': markerClusterOptions.sumLabels }, exec); var markerClusterId = markerCluster.getId(); self.OVERLAYS[markerClusterId] = markerCluster; diff --git a/www/MarkerCluster.js b/www/MarkerCluster.js index 38948d9b0..511eb0a93 100644 --- a/www/MarkerCluster.js +++ b/www/MarkerCluster.js @@ -62,6 +62,10 @@ var MarkerCluster = function (map, markerClusterOptions, _exec) { value: markerClusterOptions.boundsDraw === true, writable: false }); + Object.defineProperty(self, 'sumLabels', { + value: markerClusterOptions.sumLabels, + writable: false + }); if (self.boundsDraw) { self.map.addPolygon({ @@ -956,17 +960,18 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', { unionedMarkers.forEach(function (cluster) { var countCluster = 0; - cluster._markerArray.forEach(function (marker) { - var data = marker.get('data'); - if (data && data.data && data.data.operative == 'ECHARGE') { - countCluster = countCluster + data.data.label - } - }); - - if (countCluster == 0) { + if (self.sumLabels) { + cluster._markerArray.forEach(function (marker) { + var data = marker.get('data'); + if (data) { + countCluster = countCluster + self.getClusterLabelData(self, data, self.sumLabels) + } else { + countCluster = countCluster + 1; + } + }); + } else { countCluster = cluster.getItemLength(); } - var icon = self.getClusterIcon(cluster), clusterOpts = { 'count': countCluster, @@ -1110,6 +1115,24 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', { } }); +MarkerCluster.prototype.getClusterLabelData = function (self, data, key) { + var self = self; + var index = key.indexOf("."); + var firstPart = null; + var secondPart = null; + if (index != -1) { + firstPart = key.substr(0, index) + secondPart = key.substr(index + 1) + } else { + firstPart = key.substr(index + 1) + } + if (secondPart) { + return self.getClusterLabelData(self, data[firstPart], secondPart) + } else { + return data[firstPart]; + } +} + MarkerCluster.prototype.getClusterIcon = function (cluster) { var self = this, hit, From 56972fbf64f2c823458ea51bb881d8c8d666b389 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 28 Apr 2022 16:44:40 +0200 Subject: [PATCH 03/13] fix --- www/MarkerCluster.js | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/www/MarkerCluster.js b/www/MarkerCluster.js index 511eb0a93..672ab1f60 100644 --- a/www/MarkerCluster.js +++ b/www/MarkerCluster.js @@ -964,7 +964,7 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', { cluster._markerArray.forEach(function (marker) { var data = marker.get('data'); if (data) { - countCluster = countCluster + self.getClusterLabelData(self, data, self.sumLabels) + countCluster = countCluster + self.getClusterLabelData(data, self.sumLabels) } else { countCluster = countCluster + 1; } @@ -1115,22 +1115,10 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', { } }); -MarkerCluster.prototype.getClusterLabelData = function (self, data, key) { - var self = self; - var index = key.indexOf("."); - var firstPart = null; - var secondPart = null; - if (index != -1) { - firstPart = key.substr(0, index) - secondPart = key.substr(index + 1) - } else { - firstPart = key.substr(index + 1) - } - if (secondPart) { - return self.getClusterLabelData(self, data[firstPart], secondPart) - } else { - return data[firstPart]; - } +MarkerCluster.prototype.getClusterLabelData = function (data, key) { + var arr = key.split("."); + while(arr.length && (data = data[arr.shift()])); + return data; } MarkerCluster.prototype.getClusterIcon = function (cluster) { From c89807935365bc37f2f707c5db86241338a9e4c4 Mon Sep 17 00:00:00 2001 From: lempere Date: Wed, 22 Jun 2022 18:02:08 +0200 Subject: [PATCH 04/13] Allow to set a personalized function to custom the markerCluster icon --- www/Map.js | 3 ++- www/MarkerCluster.js | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/www/Map.js b/www/Map.js index d71a90ac1..535d967cb 100644 --- a/www/Map.js +++ b/www/Map.js @@ -1351,7 +1351,8 @@ Map.prototype.addMarkerCluster = function(markerClusterOptions, callback) { 'maxZoomLevel': Math.min(markerClusterOptions.maxZoomLevel || 15, 18), 'debug': markerClusterOptions.debug === true, 'boundsDraw': common.defaultTrueOption(markerClusterOptions.boundsDraw), - 'sumLabels': markerClusterOptions.sumLabels + 'sumLabels': markerClusterOptions.sumLabels, + 'getIcon': markerClusterOptions.getIcon }, exec); var markerClusterId = markerCluster.getId(); self.OVERLAYS[markerClusterId] = markerCluster; diff --git a/www/MarkerCluster.js b/www/MarkerCluster.js index 672ab1f60..e526f8b88 100644 --- a/www/MarkerCluster.js +++ b/www/MarkerCluster.js @@ -66,6 +66,10 @@ var MarkerCluster = function (map, markerClusterOptions, _exec) { value: markerClusterOptions.sumLabels, writable: false }); + Object.defineProperty(self, 'getIcon', { + value: markerClusterOptions.getIcon, + writable: false + }); if (self.boundsDraw) { self.map.addPolygon({ @@ -972,7 +976,7 @@ Object.defineProperty(MarkerCluster.prototype, '_redraw', { } else { countCluster = cluster.getItemLength(); } - var icon = self.getClusterIcon(cluster), + var icon = self.getIcon ? self.getIcon(cluster) : self.getClusterIcon(cluster), clusterOpts = { 'count': countCluster, 'position': cluster.getBounds().getCenter(), From 3188e1e66722f56e449f3e5b60de4c8e71d884a6 Mon Sep 17 00:00:00 2001 From: lempere Date: Mon, 1 Aug 2022 14:41:03 +0200 Subject: [PATCH 05/13] fix android fail paint.getTextBounds --- src/android/plugin/google/maps/PluginMarker.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/android/plugin/google/maps/PluginMarker.java b/src/android/plugin/google/maps/PluginMarker.java index 7c9a72ffe..e30ae087c 100644 --- a/src/android/plugin/google/maps/PluginMarker.java +++ b/src/android/plugin/google/maps/PluginMarker.java @@ -45,7 +45,7 @@ private enum Animation { protected HashMap iconLoadingTasks = new HashMap(); protected HashMap icons = new HashMap(); protected final HashMap iconCacheKeys = new HashMap(); - private static final Paint paint = new Paint(); + private static final Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); private final HashMap semaphoreAsync = new HashMap(); private boolean _clearDone = false; @@ -414,7 +414,6 @@ public void run() { marker.setVisible(true); } - // Animation String markerAnimation = null; if (opts.has("animation")) { @@ -1196,10 +1195,7 @@ protected Bitmap drawLabel(Bitmap image, Bundle labelOptions) { image.recycle(); image = null; - int fontSize = 10; - if (labelOptions.containsKey("fontSize")) { - fontSize = labelOptions.getInt("fontSize"); - } + int fontSize = labelOptions.getInt("fontSize", 10); paint.setTextSize(fontSize * density); int color = Color.BLACK; @@ -1235,6 +1231,7 @@ protected Bitmap drawLabel(Bitmap image, Bundle labelOptions) { int cHeight = rect.height(); int cWidth = rect.width(); paint.setTextAlign(Paint.Align.LEFT); + float measureText = paint.measureText(text); paint.getTextBounds(text, 0, text.length(), rect); float x = cWidth / 2f - rect.width() / 2f - rect.left; float y = cHeight / 2f + rect.height() / 2f - rect.bottom; From 266ef9c10f8021e9ae6163802e63fb25c9570a41 Mon Sep 17 00:00:00 2001 From: lempere Date: Fri, 30 Sep 2022 08:14:32 +0200 Subject: [PATCH 06/13] fix ios return twice, one with the correct image then another one without it --- src/ios/GoogleMaps/PluginMarker.m | 1 + www/MarkerCluster.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ios/GoogleMaps/PluginMarker.m b/src/ios/GoogleMaps/PluginMarker.m index 219dcaf09..e551242f9 100644 --- a/src/ios/GoogleMaps/PluginMarker.m +++ b/src/ios/GoogleMaps/PluginMarker.m @@ -1514,6 +1514,7 @@ - (void)downloadImageWithURL:(NSURL *)url completionBlock:(void (^)(BOOL succeed } else { UIImage *image = [UIImage imageNamed:iconPath]; completionBlock(YES, image); + return; } } diff --git a/www/MarkerCluster.js b/www/MarkerCluster.js index e526f8b88..d75d7409d 100644 --- a/www/MarkerCluster.js +++ b/www/MarkerCluster.js @@ -269,7 +269,7 @@ MarkerCluster.prototype.remove = function (callback) { } if (self.debug) { clearInterval(self.debugTimer); - self.self.debugTimer = undefined; + self.debugTimer = undefined; } if (self._isWorking) { From 1d42d4d760df5db9f61537027684cc1328ab576a Mon Sep 17 00:00:00 2001 From: lempere Date: Tue, 25 Oct 2022 13:22:01 +0200 Subject: [PATCH 07/13] Allow cluster manage click events and disable the zoom if is wanted --- www/Map.js | 3 ++- www/MarkerCluster.js | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/www/Map.js b/www/Map.js index 535d967cb..5b44e9af0 100644 --- a/www/Map.js +++ b/www/Map.js @@ -1352,7 +1352,8 @@ Map.prototype.addMarkerCluster = function(markerClusterOptions, callback) { 'debug': markerClusterOptions.debug === true, 'boundsDraw': common.defaultTrueOption(markerClusterOptions.boundsDraw), 'sumLabels': markerClusterOptions.sumLabels, - 'getIcon': markerClusterOptions.getIcon + 'getIcon': markerClusterOptions.getIcon, + 'clickCluster': markerClusterOptions.clickCluster }, exec); var markerClusterId = markerCluster.getId(); self.OVERLAYS[markerClusterId] = markerCluster; diff --git a/www/MarkerCluster.js b/www/MarkerCluster.js index d75d7409d..eddca4f56 100644 --- a/www/MarkerCluster.js +++ b/www/MarkerCluster.js @@ -70,6 +70,11 @@ var MarkerCluster = function (map, markerClusterOptions, _exec) { value: markerClusterOptions.getIcon, writable: false }); + // Callback to receive event and if return true will stop the zoomed + Object.defineProperty(self, 'clickCluster', { + value: markerClusterOptions.clickCluster, + writable: false + }); if (self.boundsDraw) { self.map.addPolygon({ @@ -208,6 +213,9 @@ MarkerCluster.prototype.onClusterClicked = function (cluster) { return null; } var self = this; + if (self.clickCluster && self.clickCluster(cluster)) { + return null; + } var polygon = self.get('polygon'); var bounds = cluster.getBounds(); if (self.boundsDraw) { From c44d081957db3e7f171a55c5b2622e4ff6a42f86 Mon Sep 17 00:00:00 2001 From: lempere Date: Fri, 28 Oct 2022 08:39:05 +0200 Subject: [PATCH 08/13] gradle change for cordova-android@11.0.0 --- src/android/frameworks/tbxml-android.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/frameworks/tbxml-android.gradle b/src/android/frameworks/tbxml-android.gradle index a527f8ce0..d9619a5c3 100644 --- a/src/android/frameworks/tbxml-android.gradle +++ b/src/android/frameworks/tbxml-android.gradle @@ -8,7 +8,7 @@ repositories { } dependencies { - compile(name:'tbxml-android', ext:'aar') + implementation(name:'tbxml-android', ext:'aar') } android { From dbb46da47669eba8d9e149afff2dcc768e7960d3 Mon Sep 17 00:00:00 2001 From: lempere Date: Wed, 2 Nov 2022 09:23:07 +0100 Subject: [PATCH 09/13] Add comment Delete commented unused crossWalk code --- .../plugin/google/maps/AsyncLoadImage.java | 124 ------------------ .../google/maps/AsyncLoadImageInterface.java | 2 +- .../plugin/google/maps/CordovaGoogleMaps.java | 8 -- .../plugin/google/maps/MyPluginLayout.java | 18 --- .../plugin/google/maps/PluginMarker.java | 1 + 5 files changed, 2 insertions(+), 151 deletions(-) diff --git a/src/android/plugin/google/maps/AsyncLoadImage.java b/src/android/plugin/google/maps/AsyncLoadImage.java index 38321476d..a29543fd4 100644 --- a/src/android/plugin/google/maps/AsyncLoadImage.java +++ b/src/android/plugin/google/maps/AsyncLoadImage.java @@ -141,29 +141,6 @@ protected void onPreExecute() { //String browserViewName = browserView.getClass().getName(); this.userAgent = "Mozilla"; - /* - if("org.xwalk.core.XWalkView".equals(browserViewName) || - "org.crosswalk.engine.XWalkCordovaView".equals(browserViewName)) { - - CordovaPreferences preferences = webView.getPreferences(); - // Set xwalk webview settings by Cordova preferences. - String xwalkUserAgent = preferences == null ? "" : preferences.getString("xwalkUserAgent", ""); - if (!xwalkUserAgent.isEmpty()) { - this.userAgent = xwalkUserAgent; - } - - String appendUserAgent = preferences.getString("AppendUserAgent", ""); - if (!appendUserAgent.isEmpty()) { - this.userAgent = this.userAgent + " " + appendUserAgent; - } - if ("".equals(this.userAgent)) { - this.userAgent = "Mozilla"; - } - } else { - this.userAgent = ((WebView) webView.getEngine().getView()).getSettings().getUserAgentString(); - } - */ - } protected AsyncLoadImageResult doInBackground(Void... params) { @@ -444,107 +421,6 @@ protected AsyncLoadImageResult doInBackground(Void... params) { return null; } } - /* - //-------------------------------- - // Load image from local path - //-------------------------------- - if (!iconUrl.contains("://") && - !iconUrl.startsWith("/") && - !iconUrl.startsWith("www/") && - !iconUrl.startsWith("data:image") && - !iconUrl.startsWith("./") && - !iconUrl.startsWith("../")) { - iconUrl = "./" + iconUrl; - Log.d(TAG, "--> iconUrl = " + iconUrl); - } - - if (iconUrl.startsWith("./") || iconUrl.startsWith("../")) { - iconUrl = iconUrl.replace("(\\.\\/)+", "./"); - String currentPage = this.currentPageUrl; - currentPage = currentPage.replaceAll("[^\\/]*$", ""); - currentPage = currentPage.replaceAll("#.*$", ""); - currentPage = currentPage.replaceAll("\\/[^\\/]+\\.[^\\/]+$", ""); - if (!currentPage.endsWith("/")) { - currentPage = currentPage + "/"; - } - iconUrl = currentPage + iconUrl; - iconUrl = iconUrl.replaceAll("(\\/\\.\\/+)+", "/"); - Log.d(TAG, "--> iconUrl = " + iconUrl); - } - - if (iconUrl.indexOf("data:image/") == 0 && iconUrl.contains(";base64,")) { - cacheKey = getCacheKey(iconUrl, mWidth, mHeight); - - image = getBitmapFromMemCache(cacheKey); - if (image != null) { - AsyncLoadImageResult result = new AsyncLoadImageResult(); - result.image = image; - result.cacheHit = true; - result.cacheKey = cacheKey; - return result; - } - - String[] tmp = iconUrl.split(","); - image = PluginUtil.getBitmapFromBase64encodedImage(tmp[1]); - } else if (iconUrl.indexOf("file://") == 0 && - !iconUrl.contains("file:///android_asset/")) { - iconUrl = iconUrl.replace("file://", ""); - File tmp = new File(iconUrl); - if (tmp.exists()) { - cacheKey = getCacheKey(iconUrl, mWidth, mHeight); - - image = getBitmapFromMemCache(cacheKey); - if (image != null) { - AsyncLoadImageResult result = new AsyncLoadImageResult(); - result.image = image; - result.cacheHit = true; - result.cacheKey = cacheKey; - return result; - } - - image = BitmapFactory.decodeFile(iconUrl); - } else { - //if (PluginMarker.this.mapCtrl.mPluginLayout.isDebug) { - Log.w(TAG, "icon is not found (" + iconUrl + ")"); - //} - return null; - } - } else { - Log.d(TAG, "--> iconUrl = " + iconUrl); - cacheKey = getCacheKey(iconUrl, mWidth, mHeight); - image = getBitmapFromMemCache(cacheKey); - - if (image != null) { - AsyncLoadImageResult result = new AsyncLoadImageResult(); - result.image = image; - result.cacheHit = true; - result.cacheKey = cacheKey; - return result; - } - - Log.d(TAG, "iconUrl = " + iconUrl); - if (iconUrl.indexOf("file:///android_asset/") == 0) { - iconUrl = iconUrl.replace("file:///android_asset/", ""); - } - - Log.d(TAG, "iconUrl = " + iconUrl); - if (iconUrl.contains("./")) { - try { - boolean isAbsolutePath = iconUrl.startsWith("/"); - File relativePath = new File(iconUrl); - iconUrl = relativePath.getCanonicalPath(); - Log.d(TAG, "iconUrl = " + iconUrl); - if (!isAbsolutePath) { - iconUrl = iconUrl.substring(1); - } - Log.d(TAG, "iconUrl = " + iconUrl); - } catch (Exception e) { - e.printStackTrace(); - } - } - */ - - //} if (mWidth > 0 && mHeight > 0) { mWidth = Math.round(mWidth * density); diff --git a/src/android/plugin/google/maps/AsyncLoadImageInterface.java b/src/android/plugin/google/maps/AsyncLoadImageInterface.java index 62c58c065..197afbf44 100644 --- a/src/android/plugin/google/maps/AsyncLoadImageInterface.java +++ b/src/android/plugin/google/maps/AsyncLoadImageInterface.java @@ -1,5 +1,5 @@ package plugin.google.maps; public interface AsyncLoadImageInterface { - public void onPostExecute(AsyncLoadImage.AsyncLoadImageResult result) ; + public void onPostExecute(AsyncLoadImage.AsyncLoadImageResult result); } diff --git a/src/android/plugin/google/maps/CordovaGoogleMaps.java b/src/android/plugin/google/maps/CordovaGoogleMaps.java index 165a1dd15..fd83d6709 100644 --- a/src/android/plugin/google/maps/CordovaGoogleMaps.java +++ b/src/android/plugin/google/maps/CordovaGoogleMaps.java @@ -73,14 +73,6 @@ public void initialize(final CordovaInterface cordova, final CordovaWebView webV @SuppressLint("NewApi") public void run() { - // Enable this, webView makes draw cache on the Android action bar issue. - //View view = webView.getView(); - //if (Build.VERSION.SDK_INT >= 21 || "org.xwalk.core.XWalkView".equals(view.getClass().getName())){ - // view.setLayerType(View.LAYER_TYPE_HARDWARE, null); - // Log.d("Layout", "--> view =" + view.isHardwareAccelerated()); //always false - //} - - // ------------------------------ // Check of Google Play Services // ------------------------------ diff --git a/src/android/plugin/google/maps/MyPluginLayout.java b/src/android/plugin/google/maps/MyPluginLayout.java index 044f84d5c..19228d8e3 100644 --- a/src/android/plugin/google/maps/MyPluginLayout.java +++ b/src/android/plugin/google/maps/MyPluginLayout.java @@ -153,9 +153,6 @@ public MyPluginLayout(CordovaWebView webView, Activity activity) { mActivity = activity; ViewGroup root = (ViewGroup) browserView.getParent(); this.context = browserView.getContext(); - //if (Build.VERSION.SDK_INT >= 21 || "org.xwalk.core.XWalkView".equals(browserView.getClass().getName())) { - // browserView.setLayerType(View.LAYER_TYPE_HARDWARE, null); - //} zoomScale = Resources.getSystem().getDisplayMetrics().density; Log.e(TAG, "--> zoomScale = " + zoomScale); @@ -186,21 +183,6 @@ public MyPluginLayout(CordovaWebView webView, Activity activity) { this.addView(frontLayer); root.addView(this); browserView.setBackgroundColor(Color.TRANSPARENT); - /* - if("org.xwalk.core.XWalkView".equals(browserView.getClass().getName()) - || "org.crosswalk.engine.XWalkCordovaView".equals(browserView.getClass().getName())) { - try { - // view.setZOrderOnTop(true) - // Called just in time as with root.setBackground(...) the color - // come in front and take the whole screen - browserView.getClass().getMethod("setZOrderOnTop", boolean.class) - .invoke(browserView, true); - } - catch(Exception e) { - e.printStackTrace(); - } - } - */ scrollView.setHorizontalScrollBarEnabled(false); scrollView.setVerticalScrollBarEnabled(false); startTimer(); diff --git a/src/android/plugin/google/maps/PluginMarker.java b/src/android/plugin/google/maps/PluginMarker.java index e30ae087c..f2fd2c1e3 100644 --- a/src/android/plugin/google/maps/PluginMarker.java +++ b/src/android/plugin/google/maps/PluginMarker.java @@ -1231,6 +1231,7 @@ protected Bitmap drawLabel(Bitmap image, Bundle labelOptions) { int cHeight = rect.height(); int cWidth = rect.width(); paint.setTextAlign(Paint.Align.LEFT); + // getTextBounds fail sometimes, but with the measureText before works fine float measureText = paint.measureText(text); paint.getTextBounds(text, 0, text.length(), rect); float x = cWidth / 2f - rect.width() / 2f - rect.left; From 8a828e875d8bca73bfff036915d77e849605f3dc Mon Sep 17 00:00:00 2001 From: lempere Date: Tue, 20 Dec 2022 17:01:28 +0100 Subject: [PATCH 10/13] (fix) the user can not zoom in with the click event --- www/MarkerCluster.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/MarkerCluster.js b/www/MarkerCluster.js index eddca4f56..acb027b0e 100644 --- a/www/MarkerCluster.js +++ b/www/MarkerCluster.js @@ -234,7 +234,7 @@ MarkerCluster.prototype.onClusterClicked = function (cluster) { polygon.setVisible(true); } var zoomLevel = computeZoom(cluster.getBounds(), self.map.getDiv()); - zoomLevel += zoomLevel === self.map.get('camera_zoom') ? 1 : 0; + zoomLevel += ((zoomLevel - self.map.get('camera_zoom')) < 1) ? 1 : 0; self.map.animateCamera({ target: cluster.getBounds().getCenter(), zoom: zoomLevel, From dd79eb5e5580eee4d365fb5b015a0766ee807227 Mon Sep 17 00:00:00 2001 From: Guillem Perez Date: Tue, 7 Feb 2023 09:51:21 +0100 Subject: [PATCH 11/13] Update AsyncLoadImage.java Allow currentPageUrl ionic3 with only https:/localhost/ --- src/android/plugin/google/maps/AsyncLoadImage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/plugin/google/maps/AsyncLoadImage.java b/src/android/plugin/google/maps/AsyncLoadImage.java index 08f0f4a78..1cdebaffb 100644 --- a/src/android/plugin/google/maps/AsyncLoadImage.java +++ b/src/android/plugin/google/maps/AsyncLoadImage.java @@ -173,7 +173,7 @@ protected AsyncLoadImageResult doInBackground(Void... params) { //-------------------------------- if (!iconUrl.startsWith("data:image")) { - if ( currentPageUrl.matches("https?://(localhost|127.0.0.1)/(.)+") ) { + if ( currentPageUrl.matches("https?://(localhost|127.0.0.1)/(.)*") ) { // Log.d(TAG, String.format("---->(201)iconURL = %s", iconUrl)); if (iconUrl.contains("://")) { iconUrl = iconUrl.replaceAll("https?://.+?/", "file:///android_asset/www/"); From 753e6803735d22fb487747aa72f767183268d957 Mon Sep 17 00:00:00 2001 From: Guillem Perez Date: Wed, 15 Mar 2023 17:08:21 +0100 Subject: [PATCH 12/13] Add more range to allow break cluster on zoom click on some devices --- www/MarkerCluster.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/MarkerCluster.js b/www/MarkerCluster.js index acb027b0e..a9f6130c1 100644 --- a/www/MarkerCluster.js +++ b/www/MarkerCluster.js @@ -234,7 +234,7 @@ MarkerCluster.prototype.onClusterClicked = function (cluster) { polygon.setVisible(true); } var zoomLevel = computeZoom(cluster.getBounds(), self.map.getDiv()); - zoomLevel += ((zoomLevel - self.map.get('camera_zoom')) < 1) ? 1 : 0; + zoomLevel += ((zoomLevel - self.map.get('camera_zoom')) < 1.5) ? 1 : 0; self.map.animateCamera({ target: cluster.getBounds().getCenter(), zoom: zoomLevel, From f4e4af1ac9708b5681510846a1d07a5a45523ce9 Mon Sep 17 00:00:00 2001 From: Alejandro Rodriguez Date: Thu, 14 Nov 2024 15:03:19 +0100 Subject: [PATCH 13/13] remove point of interest click listener to prevent click issues when there's a marker in top of a point of interest --- src/android/plugin/google/maps/PluginMap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/plugin/google/maps/PluginMap.java b/src/android/plugin/google/maps/PluginMap.java index de5018ad5..f01a822e8 100644 --- a/src/android/plugin/google/maps/PluginMap.java +++ b/src/android/plugin/google/maps/PluginMap.java @@ -427,7 +427,7 @@ public void onClick(View v) { map.setOnInfoWindowLongClickListener(PluginMap.this); map.setOnInfoWindowCloseListener(PluginMap.this); map.setOnMyLocationClickListener(PluginMap.this); - map.setOnPoiClickListener(PluginMap.this); + map.setOnPoiClickListener(null); //Custom info window map.setInfoWindowAdapter(PluginMap.this);