diff --git a/README.md b/README.md index 4d5b800..efdf8b8 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ Travis will now run a build and publish to NPM. ## Release Notes +### 4.4.21 - 11/10/2023 + +* fixes issue that causes non-effecting error in console from MapPanel.vue when searching an address with the L&I topic open + ### 4.4.20 - 11/10/2023 * fixes bug in store.js diff --git a/src/components/MapPanel.vue b/src/components/MapPanel.vue index 6846c93..dce0230 100644 --- a/src/components/MapPanel.vue +++ b/src/components/MapPanel.vue @@ -1289,11 +1289,14 @@ export default { } }, activeGeojsonForTopic(nextActiveGeojsonForTopic) { - // let nextGeojson = this.$store.state.sources.liBuildingFootprints.data.features.filter(function(item) { - let nextGeojson = this.$store.state.sources.liBuildingFootprints.data.filter(function(item) { - // console.log('in filter, item:', item, 'item.id:', item.id); - return item.attributes.BIN === nextActiveGeojsonForTopic; - }); + let liBuildingFootprints = this.$store.state.sources.liBuildingFootprints.data; + let nextGeojson; + if (liBuildingFootprints) { + nextGeojson = this.$store.state.sources.liBuildingFootprints.data.filter(function(item) { + // console.log('in filter, item:', item, 'item.id:', item.id); + return item.attributes.BIN === nextActiveGeojsonForTopic; + }); + } // console.log('watch activeDorParcel is running, nextActiveDorParcel:', nextActiveDorParcel, 'nextGeojson:', nextGeojson); if (nextGeojson[0]) { // console.log('watch geojsonParcels is running, nextGeojson:', nextGeojson, 'nextGeojson[0].geojson:', nextGeojson[0].geojson); @@ -1305,16 +1308,16 @@ export default { } }, activeLiBuilding(nextActiveLiBuilding) { - // let nextGeojson = this.$store.state.sources.liBuildingFootprints.data.features.filter(function(item) { - let nextGeojson = this.$store.state.sources.liBuildingFootprints.data.filter(function(item) { - // console.log('in filter, item:', item, 'item.id:', item.id); - return item.attributes.BIN === nextActiveLiBuilding; - }); - // console.log('watch activeDorParcel is running, nextActiveDorParcel:', nextActiveDorParcel, 'nextGeojson:', nextGeojson); - // if (this.$store.map) { - // console.log('watch activeDorParcel is running, map.getStyle():', this.$store.map.getStyle(), 'map.getStyle().layers:', this.$store.map.getStyle().layers, 'nextGeojson:', nextGeojson); - // } - if (nextGeojson[0]) { + let liBuildingFootprints = this.$store.state.sources.liBuildingFootprints.data; + let nextGeojson; + if (liBuildingFootprints) { + nextGeojson = this.$store.state.sources.liBuildingFootprints.data.filter(function(item) { + // console.log('in filter, item:', item, 'item.id:', item.id); + return item.attributes.BIN === nextActiveLiBuilding; + }); + } + + if (nextGeojson && nextGeojson[0]) { // console.log('watch geojsonParcels is running, nextGeojson:', nextGeojson, 'nextGeojson[0].geojson:', nextGeojson[0].geojson); this.geojsonForActiveBuildingBoolean = true; this.$data.geojsonForActiveBuildingSource.data.geometry.coordinates = nextGeojson[0].geometry.rings;