Skip to content

Commit

Permalink
Merge pull request #128 from SuokN/main
Browse files Browse the repository at this point in the history
fix: the nearest arrow keep showing 70 treetracker-we-map-client
  • Loading branch information
dadiorchen committed Nov 3, 2022
2 parents b27f405 + 0bb88b6 commit dbc3783
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ export default class Map {
log.warn('load finished')
this.spin.hide()
this.alert.hide()
this._checkArrow()
},
onDestroy: () => {
log.warn('destroy')
Expand Down Expand Up @@ -324,7 +325,6 @@ export default class Map {

this.layerUtfGrid.on('load', () => {
log.info('all grid loaded!')
this._checkArrow()
})

this.layerUtfGrid.on('tileunload', (e) => {
Expand Down Expand Up @@ -352,13 +352,6 @@ export default class Map {

// bind the finding marker function
this.layerUtfGrid.hasMarkerInCurrentView = () => {
// waiting layer is ready
const isLoading = this.layerUtfGrid.isLoading()
log.warn('utf layer is loading:', isLoading)
if (isLoading) {
log.warn('can not handle the grid utf check when loading, cancel!')
return false
}
const begin = Date.now()
let found = false
let count = 0
Expand Down Expand Up @@ -960,6 +953,7 @@ export default class Map {
log.info('check arrow...')
if (this.layerUtfGrid.hasMarkerInCurrentView()) {
log.info('found marker')
this.nearestTreeArrow.hideArrow()
} else {
log.info('no marker')
const nearest = await this._getNearest()
Expand Down

0 comments on commit dbc3783

Please sign in to comment.