Skip to content

Commit

Permalink
Merge pull request #254 from Element84/ba/bug/grid-code-select-error
Browse files Browse the repository at this point in the history
select any results on click not just single scenes
  • Loading branch information
bradleyandrick authored Sep 12, 2023
2 parents eab7c77 + 7f7e068 commit 31dd6a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/mapHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function mapClickHandler(e) {
const clickBounds = L.latLngBounds(e.latlng, e.latlng)
if (map && Object.keys(map).length > 0) {
const _searchType = store.getState().mainSlice.searchType
const _mappedScenes = store.getState().mainSlice.mappedScenes
const _searchResults = store.getState().mainSlice.searchResults

clearMapSelection()

Expand All @@ -101,9 +101,9 @@ export function mapClickHandler(e) {

// pull all items from search results that intersect with the click bounds
let intersectingFeatures = []
if (_mappedScenes !== null) {
for (const f in _mappedScenes) {
const feature = _mappedScenes[f]
if (_searchResults !== null) {
for (const f in _searchResults.features) {
const feature = _searchResults.features[f]
const featureBounds = L.geoJSON(feature).getBounds()
if (featureBounds && featureBounds.intersects(clickBounds)) {
// highlight layer
Expand Down

0 comments on commit 31dd6a8

Please sign in to comment.