diff --git a/dist/leaflet.markercluster-src.js b/dist/leaflet.markercluster-src.js index d390e8556e..2c4a3e6325 100644 --- a/dist/leaflet.markercluster-src.js +++ b/dist/leaflet.markercluster-src.js @@ -57,17 +57,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ return this.addLayers(array); } - if (this.options.singleMarkerMode) { - layer.options.icon = this.options.iconCreateFunction({ - getChildCount: function () { - return 1; - }, - getAllChildMarkers: function () { - return [layer]; - } - }); - } - if (!this._map) { this._needsClustering.push(layer); return this; @@ -536,6 +525,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ gridUnclustered = this._gridUnclustered, markerPoint, z; + if (this.options.singleMarkerMode) { + layer.options.icon = this.options.iconCreateFunction({ + getChildCount: function () { + return 1; + }, + getAllChildMarkers: function () { + return [layer]; + } + }); + } + //Find the lowest zoom level to slot this one in for (; zoom >= 0; zoom--) { markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 7a6c262513..c4affab819 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -50,17 +50,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ return this.addLayers(array); } - if (this.options.singleMarkerMode) { - layer.options.icon = this.options.iconCreateFunction({ - getChildCount: function () { - return 1; - }, - getAllChildMarkers: function () { - return [layer]; - } - }); - } - if (!this._map) { this._needsClustering.push(layer); return this; @@ -529,6 +518,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ gridUnclustered = this._gridUnclustered, markerPoint, z; + if (this.options.singleMarkerMode) { + layer.options.icon = this.options.iconCreateFunction({ + getChildCount: function () { + return 1; + }, + getAllChildMarkers: function () { + return [layer]; + } + }); + } + //Find the lowest zoom level to slot this one in for (; zoom >= 0; zoom--) { markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position