Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

177 Fixing 'leaflet_id' in undefined runtime error #178

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.eslintcache
.idea
6 changes: 3 additions & 3 deletions src/Map.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The main model for the treetracker model
*/
import regeneratorRuntime from 'regenerator-runtime'

Check warning on line 4 in src/Map.js

View workflow job for this annotation

GitHub Actions / Release

'regeneratorRuntime' is defined but never used
import axios from 'axios'
import expect from 'expect-runtime'
import log from 'loglevel'
Expand Down Expand Up @@ -406,12 +406,12 @@
}

async _unloadTileServer() {
if (this.map.hasLayer(this.layerTile)) {
if (this.layerTile && this.map.hasLayer(this.layerTile)) {
this.map.removeLayer(this.layerTile)
} else {
log.warn('try to remove nonexisting tile layer')
}
if (this.map.hasLayer(this.layerUtfGrid)) {
if (this.layerUtfGrid && this.map.hasLayer(this.layerUtfGrid)) {
this.map.removeLayer(this.layerUtfGrid)
} else {
log.warn('try to remove nonexisting grid layer')
Expand Down Expand Up @@ -593,7 +593,7 @@
this.layerSelected?.payload,
)

if (this.map.hasLayer(this.layerSelected)) {
if (this.layerSelected && this.map.hasLayer(this.layerSelected)) {
this.map.removeLayer(this.layerSelected)
} else {
log.warn('try to remove nonexisting layer selected')
Expand Down Expand Up @@ -1292,7 +1292,7 @@
if (zoomLevel) {
this.map.setView([lat, lon], zoomLevel, { animate: false })
} else {
const originalZoomLevel = this.map.getZoom()

Check warning on line 1295 in src/Map.js

View workflow job for this annotation

GitHub Actions / Release

'originalZoomLevel' is assigned a value but never used
this.map.setView([lat, lon], zoomLevel, { animate: false })
}
}
Expand Down
Loading