Skip to content

Commit

Permalink
style: eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukaii committed Aug 10, 2022
1 parent 8a3c759 commit 0ab73ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14
10 changes: 5 additions & 5 deletions src/lib/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class MapFactoryController {
}

getFactoriesLayerForStatus (factoryStatus: FactoryDisplayStatusType) {
let CLUSTER_DISTANCE = 50;
const CLUSTER_DISTANCE = 50
if (!this._factoriesLayerStatusMap[`${factoryStatus}`]) {
this._factoriesLayerStatusMap[`${factoryStatus}`] = new VectorSource({ features: [] })
const clusterSource = new Cluster({
Expand All @@ -137,13 +137,13 @@ export class MapFactoryController {
const vectorLayer = new VectorLayer({
source: clusterSource,
zIndex: 3,
style: (feature,resolution) => {
let zoom = this.mapInstance.map.getView().getZoom()!;
style: (feature, resolution) => {
const zoom = this.mapInstance.map.getView().getZoom()!

if (zoom > 16) {
if (clusterSource.getDistance() !== 0) clusterSource.setDistance(0);
if (clusterSource.getDistance() !== 0) clusterSource.setDistance(0)
} else {
if (clusterSource.getDistance() !== CLUSTER_DISTANCE) clusterSource.setDistance(CLUSTER_DISTANCE);
if (clusterSource.getDistance() !== CLUSTER_DISTANCE) clusterSource.setDistance(CLUSTER_DISTANCE)
}

const features = feature.get('features')
Expand Down

0 comments on commit 0ab73ce

Please sign in to comment.