Skip to content

Commit

Permalink
fix(place-input): fix switching raw coordinates
Browse files Browse the repository at this point in the history
fix #171
  • Loading branch information
amoncaldas committed Sep 23, 2021
1 parent 62abd42 commit fe88dce
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/fragments/forms/place-input/place-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,11 @@ export default {
if (context.directIsAvailable && context.$store.getters.mapSettings.skipAllSegments) {
newVal.direct = true
}
let localSuggestions = context.localModel.suggestions
context.localModel = newVal.clone()
if (localSuggestions.length > 0 && newVal.suggestions.length === 0) {
context.localModel.suggestions = localSuggestions
}
context.resolveModel()
}, 1000)
},
Expand Down Expand Up @@ -804,10 +808,9 @@ export default {
switchCoords () {
if (this.model.nameIsCoord()) {
let coordinates = this.model.getCoordsFromName()
let switchedCords = coordinates.reverse()
this.model.setLnglat(switchedCords[0], switchedCords[1])
coordinates.reverse()
this.model.setLnglat(coordinates[1], coordinates[0])
this.model.setCoordsAsName()
this.localModel = this.model.clone()
this.autocompleteByCoords()
}
},
Expand Down

0 comments on commit fe88dce

Please sign in to comment.