Skip to content

Commit

Permalink
refactor: resolve warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Seli0303 committed Jun 11, 2024
1 parent 343e917 commit 0e421a6
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions src/models/place.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import {
Geocode,
ReverseGeocode
} from '@/support/ors-api-runner'
import { Geocode, ReverseGeocode } from '@/support/ors-api-runner'
import GeoUtils from '@/support/geo-utils'
import lodash from 'lodash'

/**
* Place model class
* @param {Number} lat - default null
Expand Down Expand Up @@ -69,8 +67,7 @@ class Place {
return [this.lng, this.lat]
} else {
if (this.nameIsNumeric()) {
const coords = this.getCoordsFromName()
return coords
return this.getCoordsFromName()
} else {
return [0, 0]
}
Expand All @@ -89,14 +86,6 @@ class Place {
return GeoUtils.buildLatLong(this.lat, this.lng)
}

/**
* Returns an array containing lat and lng
* @returns {Array} containing [lat, lng]
*/
getLatLngArr() {
return this.getLngLatArr().reverse()
}

/**
* Set the suggestions
* @param {Array} places
Expand Down Expand Up @@ -185,8 +174,7 @@ class Place {
*/
setCoordsAsName() {
if (this.lat && this.lng) {
const coords = `${this.lat},${this.lng}`
this.placeName = coords
this.placeName = `${this.lat},${this.lng}`
}
}

Expand Down Expand Up @@ -300,6 +288,8 @@ class Place {
* Build a place using only lng and lat
* @param {*} lng
* @param {*} lat
* @param placeName
* @param options
*/
static build(lng, lat, placeName = '', options = {}) {
return new Place(lng, lat, placeName, options)
Expand Down

0 comments on commit 0e421a6

Please sign in to comment.