Skip to content

Commit

Permalink
happy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Jan 16, 2024
1 parent a771c83 commit 1909f17
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,14 @@ ClusterLayer.registerRenderer('canvas', class extends maptalks.renderer.VectorLa

// if no clusters is hit, identify markers
if (this._markersToDraw) {
var point = map.coordinateToContainerPoint(coordinate)
var minDistance = point.distanceTo(map.coordinateToContainerPoint(this._markersToDraw[0]._coordinates))
var hitPoint = this._markersToDraw[0]
for(var i = 1; i < this._markersToDraw.length; i++) {
var dis = point.distanceTo(map.coordinateToContainerPoint(this._markersToDraw[i]._coordinates))
const point = map.coordinateToContainerPoint(coordinate);
let minDistance = point.distanceTo(map.coordinateToContainerPoint(this._markersToDraw[0]._coordinates));
let hitPoint = this._markersToDraw[0];
for (let i = 1; i < this._markersToDraw.length; i++) {
const dis = point.distanceTo(map.coordinateToContainerPoint(this._markersToDraw[i]._coordinates));
if (minDistance > dis) {
minDistance = dis
hitPoint = this._markersToDraw[i]
minDistance = dis;
hitPoint = this._markersToDraw[i];
}
}
return hitPoint;
Expand Down

0 comments on commit 1909f17

Please sign in to comment.