change name from MarkerClusterer to MarkerCluster
MODIFY
.gitignore
.gitignore
@@ -44,10 +44,3 @@ platforms/
hooks/
out/
-
-
-#other project files
-src/android/plugin/google/maps/experimental
-src/android/plugin/google/maps/PluginMarkerCluster.java
-platforms/android/res/xml/drawable/m1.png
-platforms/android/lint.xml

MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="cluster-20170626-1612" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="cluster-20170626-1726" 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="BaseClass" src="www/BaseClass.js">
<runs />
<js-module name="Environment" src="www/Environment.js">
<runs />
</js-module>
- <js-module name="MarkerClusterer" src="www/MarkerClusterer.js">
+ <js-module name="MarkerCluster" src="www/MarkerCluster.js">
<runs />
</js-module>
<js-module name="Cluster" src="www/Cluster.js">
<feature name="TileOverlay">
<param name="ios-package" value="PluginTileOverlay" />
</feature>
- <feature name="PluginMarkerClusterer">
- <param name="ios-package" value="PluginMarkerClusterer" />
+ <feature name="PluginMarkerCluster">
+ <param name="ios-package" value="PluginMarkerCluster" />
</feature>
</config-file>
<source-file src="src/ios/GoogleMaps/MyPluginLayerDebugView.m" />
<header-file src="src/ios/GoogleMaps/MyPluginScrollView.h" />
<source-file src="src/ios/GoogleMaps/MyPluginScrollView.m" />
- <header-file src="src/ios/GoogleMaps/PluginMarkerClusterer.h" />
- <source-file src="src/ios/GoogleMaps/PluginMarkerClusterer.m" />
+ <header-file src="src/ios/GoogleMaps/PluginMarkerCluster.h" />
+ <source-file src="src/ios/GoogleMaps/PluginMarkerCluster.m" />
<config-file target="*-Info.plist" parent="Google Maps API Key">
<string>$API_KEY_FOR_IOS</string>

RENAME
src/android/plugin/google/maps/PluginMarkerClusterer.java
src/android/plugin/google/maps/PluginMarkerCluster.java
@@ -19,7 +19,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-public class PluginMarkerClusterer extends MyPlugin implements MyPluginInterface {
+public class PluginMarkerCluster extends MyPlugin implements MyPluginInterface {
private final static HashMap<String, String> pluginMarkers = new HashMap<String, String>();
private final static ConcurrentHashMap<String, String> pluginPolylines = new ConcurrentHashMap<String, String>();

RENAME
src/ios/GoogleMaps/PluginMarkerClusterer.h
src/ios/GoogleMaps/PluginMarkerCluster.h
#import "PluginMarker.h"
#import "NSData+Base64.h"
-@interface PluginMarkerClusterer : CDVPlugin<MyPlgunProtocol>
+@interface PluginMarkerCluster : CDVPlugin<MyPlgunProtocol>
@property (nonatomic, strong) NSCache* imgCache;
@property (nonatomic) NSOperationQueue *executeQueue;

RENAME
src/ios/GoogleMaps/PluginMarkerClusterer.m
src/ios/GoogleMaps/PluginMarkerCluster.m
//
//
-#import "PluginMarkerClusterer.h"
-@implementation PluginMarkerClusterer
+#import "PluginMarkerCluster.h"
+@implementation PluginMarkerCluster
const NSString *GEOCELL_ALPHABET = @"0123456789abcdef";
const int GEOCELL_GRID_SIZE = 4;

RENAME
www/MarkerClusterer.js
www/MarkerCluster.js
@@ -13,9 +13,9 @@ var argscheck = require('cordova/argscheck'),
BaseArrayClass = require('./BaseArrayClass');
/*****************************************************************************
- * MarkerClusterer Class
+ * MarkerCluster Class
*****************************************************************************/
-var MarkerClusterer = function(map, id, markerClusterOptions) {
+var MarkerCluster = function(map, id, markerClusterOptions) {
BaseClass.call(this);
var self = this;
@@ -32,7 +32,7 @@ var MarkerClusterer = function(map, id, markerClusterOptions) {
writable: false
});
Object.defineProperty(self, "type", {
- value: "MarkerClusterer",
+ value: "MarkerCluster",
writable: false
});
Object.defineProperty(self, "id", {
@@ -60,22 +60,22 @@ var MarkerClusterer = function(map, id, markerClusterOptions) {
self.onCameraMoveEnd();
};
-utils.extend(MarkerClusterer, BaseClass);
+utils.extend(MarkerCluster, BaseClass);
-MarkerClusterer.prototype.getPluginName = function() {
- return this.map.getId() + "-markerclusterer";
+MarkerCluster.prototype.getPluginName = function() {
+ return this.map.getId() + "-MarkerCluster";
};
-MarkerClusterer.prototype.getId = function() {
+MarkerCluster.prototype.getId = function() {
return this.id;
};
-MarkerClusterer.prototype.getMap = function() {
+MarkerCluster.prototype.getMap = function() {
return this.map;
};
-MarkerClusterer.prototype.getHashCode = function() {
+MarkerCluster.prototype.getHashCode = function() {
return this.hashCode;
};
-MarkerClusterer.prototype.onCameraMoveEnd = function() {
+MarkerCluster.prototype.onCameraMoveEnd = function() {
var self = this;
var prevZoom = self.get("zoom");
@@ -87,7 +87,7 @@ MarkerClusterer.prototype.onCameraMoveEnd = function() {
};
-MarkerClusterer.prototype.redraw = function() {
+MarkerCluster.prototype.redraw = function() {
var self = this,
map = self.map,
mapDiv = map.getDiv(),
@@ -117,8 +117,9 @@ MarkerClusterer.prototype.redraw = function() {
self._clusters[resolution] = self._clusters[resolution] || {};
var deleteClusters = [];
var cellLen = resolution + 1;
+ var keys;
if (resolution === prevResolution) {
- var keys = Object.keys(self._clusters[resolution]);
+ keys = Object.keys(self._clusters[resolution]);
keys.forEach(function(geocell) {
var bounds = self._clusters[resolution][geocell].getBounds();
if (!extendedBounds.contains(bounds.northeast) &&
@@ -129,7 +130,7 @@ MarkerClusterer.prototype.redraw = function() {
}
});
} else if (prevResolution in self._clusters) {
- var keys = Object.keys(self._clusters[prevResolution]);
+ keys = Object.keys(self._clusters[prevResolution]);
keys.forEach(function(geocell) {
self._clusters[prevResolution][geocell].remove();
});
@@ -227,4 +228,4 @@ MarkerClusterer.prototype.redraw = function() {
};
-module.exports = MarkerClusterer;
+module.exports = MarkerCluster;

change name from MarkerClusterer to MarkerCluster