@react-google-maps/marker-clusterer
Advanced tools
Comparing version 1.2.3-alpha.8 to 1.2.3
@@ -35,3 +35,6 @@ "use strict"; | ||
for (var i = 0; i < markers.length; i++) { | ||
bounds.extend(markers[i].getPosition()); | ||
var position = markers[i].getPosition(); | ||
if (position) { | ||
bounds.extend(position); | ||
} | ||
} | ||
@@ -50,10 +53,16 @@ return bounds; | ||
if (!this.center) { | ||
this.center = marker.getPosition(); | ||
this.calculateBounds(); | ||
var position = marker.getPosition(); | ||
if (position) { | ||
this.center = position; | ||
this.calculateBounds(); | ||
} | ||
} | ||
else { | ||
if (this.averageCenter) { | ||
var length_1 = this.markers.length + 1; | ||
this.center = new google.maps.LatLng((this.center.lat() * (length_1 - 1) + marker.getPosition().lat()) / length_1, (this.center.lng() * (length_1 - 1) + marker.getPosition().lng()) / length_1); | ||
this.calculateBounds(); | ||
var position = marker.getPosition(); | ||
if (position) { | ||
var length_1 = this.markers.length + 1; | ||
this.center = new google.maps.LatLng((this.center.lat() * (length_1 - 1) + position.lat()) / length_1, (this.center.lng() * (length_1 - 1) + position.lng()) / length_1); | ||
this.calculateBounds(); | ||
} | ||
} | ||
@@ -88,3 +97,6 @@ } | ||
if (this.bounds !== null) { | ||
return this.bounds.contains(marker.getPosition()); | ||
var position = marker.getPosition(); | ||
if (position) { | ||
return this.bounds.contains(position); | ||
} | ||
} | ||
@@ -91,0 +103,0 @@ return false; |
@@ -124,3 +124,6 @@ "use strict"; | ||
for (var i = 0; i < markers.length; i++) { | ||
bounds.extend(markers[i].getPosition()); | ||
var position = markers[i].getPosition(); | ||
if (position) { | ||
bounds.extend(position); | ||
} | ||
} | ||
@@ -350,3 +353,7 @@ this.getMap().fitBounds(bounds); | ||
Clusterer.prototype.isMarkerInBounds = function (marker, bounds) { | ||
return bounds.contains(marker.getPosition()); | ||
var position = marker.getPosition(); | ||
if (position) { | ||
return bounds.contains(position); | ||
} | ||
return false; | ||
}; | ||
@@ -360,4 +367,5 @@ Clusterer.prototype.addToClosestCluster = function (marker) { | ||
var center = cluster.getCenter(); | ||
if (center) { | ||
var d = this.distanceBetweenPoints(center, marker.getPosition()); | ||
var position = marker.getPosition(); | ||
if (center && position) { | ||
var d = this.distanceBetweenPoints(center, position); | ||
if (d < distance) { | ||
@@ -387,3 +395,3 @@ distance = d; | ||
if (this.timerRefStatic !== null) { | ||
clearTimeout(this.timerRefStatic); | ||
window.clearTimeout(this.timerRefStatic); | ||
delete this.timerRefStatic; | ||
@@ -408,3 +416,3 @@ } | ||
if (iLast < this.markers.length) { | ||
this.timerRefStatic = setTimeout(function () { | ||
this.timerRefStatic = window.setTimeout(function () { | ||
_this.createClusters(iLast); | ||
@@ -411,0 +419,0 @@ }, 0); |
{ | ||
"name": "@react-google-maps/marker-clusterer", | ||
"version": "1.2.3-alpha.8", | ||
"version": "1.2.3", | ||
"description": "Marker Clusterer for React.js Google Maps API", | ||
@@ -41,3 +41,6 @@ "license": "MIT", | ||
"scripts": { | ||
"build": "rimraf ./lib && tsc", | ||
"build": "yarn build:commonjs && yarn build:esm && yarn build:umd", | ||
"build:commonjs": "rimraf ./lib && tsc -p ./tsconfig-commonjs.json", | ||
"build:esm": "rimraf ./esm && tsc -p ./tsconfig-esm.json", | ||
"build:umd": "rimraf ./umd && tsc -p ./tsconfig-umd.json", | ||
"clean": "rimraf ./package-lock.json ./yarn.lock ./node_modules/ && yarn", | ||
@@ -47,6 +50,6 @@ "update": "yarn-check -u", | ||
"pub": "yarn build && yarn publish .", | ||
"tc": "tsc -p ./tsconfig.json --noEmit --traceResolution" | ||
"tc": "tsc -p ./tsconfig-commonjs.json --noEmit --traceResolution" | ||
}, | ||
"dependencies": { | ||
"@types/googlemaps": "3.30.19" | ||
"@types/googlemaps": "3.36.0" | ||
}, | ||
@@ -56,4 +59,4 @@ "devDependencies": { | ||
"@types/babel-types": "7.0.7", | ||
"@typescript-eslint/eslint-plugin": "1.7.0", | ||
"@typescript-eslint/parser": "1.7.0", | ||
"@typescript-eslint/eslint-plugin": "1.9.0", | ||
"@typescript-eslint/parser": "1.9.0", | ||
"acorn": "6.1.1", | ||
@@ -69,20 +72,21 @@ "awesome-typescript-loader": "5.2.1", | ||
"eslint-plugin-filenames": "1.3.2", | ||
"eslint-plugin-html": "5.0.3", | ||
"eslint-plugin-import": "2.17.2", | ||
"eslint-plugin-html": "5.0.5", | ||
"eslint-plugin-import": "2.17.3", | ||
"eslint-plugin-json": "1.4.0", | ||
"eslint-plugin-jsx-a11y": "6.2.1", | ||
"eslint-plugin-no-inferred-method-name": "1.0.2", | ||
"eslint-plugin-node": "8.0.1", | ||
"eslint-plugin-node": "9.1.0", | ||
"eslint-plugin-optimize-regex": "1.1.6", | ||
"eslint-plugin-promise": "4.1.1", | ||
"eslint-plugin-react": "7.12.4", | ||
"eslint-plugin-react": "7.13.0", | ||
"eslint-plugin-react-functional-set-state": "1.2.1", | ||
"eslint-plugin-react-hooks": "1.6.0", | ||
"eslint-plugin-react-perf": "3.1.0", | ||
"eslint-plugin-standard": "4.0.0", | ||
"eslint-plugin-you-dont-need-lodash-underscore": "6.4.0", | ||
"eslint-plugin-you-dont-need-lodash-underscore": "6.5.0", | ||
"rimraf": "2.6.3", | ||
"typescript": "3.4.5", | ||
"webpack": "4.30.0" | ||
"webpack": "4.32.2" | ||
}, | ||
"gitHead": "4c487da5fec5e5d9e86f8d445248353b1f532a59" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
79575
2038
1
31
+ Added@types/googlemaps@3.36.0(transitive)
- Removed@types/googlemaps@3.30.19(transitive)
Updated@types/googlemaps@3.36.0