Bug fix: regular marker does not render
MODIFY
src/browser/PluginMarker.js
src/browser/PluginMarker.js
@@ -37,10 +37,10 @@ PluginMarker.prototype.__create = function(markerId, pluginOptions, onSuccess) {
var markerOpts = {
'overlayId': markerId,
'position': pluginOptions.position,
- 'map': map,
'disableAutoPan': pluginOptions.disableAutoPan === true,
'draggable': pluginOptions.draggable === true
};
+
var iconSize = null;
if (pluginOptions.animation) {
markerOpts.animation = google.maps.Animation[pluginOptions.animation.toUpperCase()];
@@ -73,12 +73,12 @@ PluginMarker.prototype.__create = function(markerId, pluginOptions, onSuccess) {
iconSize = icon.size;
}
}
- }
-
- if (icon.anchor) {
+ if ('anchor' in icon && Array.isArray(icon.anchor)) {
markerOpts.icon.anchor = new google.maps.Point(icon.anchor[0], icon.anchor[1]);
}
}
+
+ }
if (!markerOpts.icon ||
!markerOpts.icon.url && !markerOpts.icon.path) {
// default marker
@@ -95,7 +95,7 @@ PluginMarker.prototype.__create = function(markerId, pluginOptions, onSuccess) {
'height': 28
};
}
- markerOpts.optimized = true;
+ markerOpts.map = map;
var marker = new google.maps.Marker(markerOpts);
marker.addListener('click', self.onMarkerClickEvent.bind(self, event.MARKER_CLICK, marker), {passive: true});
marker.addListener('dragstart', self.onMarkerEvent.bind(self, event.MARKER_DRAG_START, marker));

MODIFY
src/browser/PluginMarkerCluster.js
src/browser/PluginMarkerCluster.js
-
var utils = require('cordova/utils'),
event = require('cordova-plugin-googlemaps.event'),
PluginMarker = require('cordova-plugin-googlemaps.PluginMarker'),
@@ -255,10 +254,14 @@ PluginMarkerCluster.prototype.redrawClusters = function(onSuccess, onError, args
//-------------------
if (isNew) {
properties = self.pluginMap.objects["marker_property_" + clusterId_markerId];
+
tasks.push(new Promise(function(resolve, reject) {
- markerProperties.opacity = 0;
- self.__create.call(self, clusterId_markerId, properties, function(marker, properties) {
+ self.__create.call(self, clusterId_markerId, {
+ 'position': properties.position,
+ 'icon': properties.icon,
+ 'disableAutoPan': properties.disableAutoPan
+ }, function(marker, properties) {
if (markerProperties.title) {
marker.set('title', markerProperties.title);
}
@@ -275,8 +278,6 @@ PluginMarkerCluster.prototype.redrawClusters = function(onSuccess, onError, args
'width': properties.width,
'height': properties.height
};
-console.log('---->1');
- marker.setOpacity(1);
resolve();
}
});

Bug fix: regular marker does not render