(Browser) Fix: MarkerOptions.zIndex does not work
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.4.4-beta-20180912-1506" 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.4.4-beta-20180912-1517" 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">
<runs/>

MODIFY
src/browser/PluginMarker.js
src/browser/PluginMarker.js
@@ -94,6 +94,10 @@ PluginMarker.prototype.__create = function(markerId, pluginOptions, onSuccess) {
'height': 28
};
}
+
+ if ('zIndex' in pluginOptions) {
+ markerOpts.zIndex = pluginOptions.zIndex;
+ }
markerOpts.map = map;
var marker = new google.maps.Marker(markerOpts);
marker.addListener('click', self.onMarkerClickEvent.bind(self, event.MARKER_CLICK, marker), {passive: true});
@@ -268,6 +272,25 @@ PluginMarker.prototype.setOpacity = function(onSuccess, onError, args) {
}
onSuccess();
};
+
+PluginMarker.prototype.setIconAnchor = function(onSuccess, onError, args) {
+ var self = this;
+ var overlayId = args[0];
+ var anchorX = args[1],
+ anchorY = args[2];
+ var marker = self.pluginMap.objects[overlayId];
+ if (marker) {
+ var icon = marker.getIcon();
+ if (typeof icon === "string") {
+ icon = {
+ 'url': icon
+ };
+ }
+ icon.anchor = new google.maps.Point(anchorX, anchorY);
+ marker.setIcon(icon);
+ }
+ onSuccess();
+};
PluginMarker.prototype.setZIndex = function(onSuccess, onError, args) {
var self = this;
var overlayId = args[0];

(Browser) Fix: MarkerOptions.zIndex does not work