Skip to content

Commit

Permalink
Merge pull request #34 from UCF/show-param
Browse files Browse the repository at this point in the history
Building ID Zoom
  • Loading branch information
jmbarne3 authored Jun 27, 2024
2 parents 3a9f7bf + 25e92c6 commit 17fb5fe
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import './App.scss'

// React Imports
import { useMemo, useRef, useState } from 'react'
import { useEffect, useMemo, useRef, useState } from 'react'

// Map GL imports
import {
Expand Down Expand Up @@ -367,6 +367,20 @@ function App() {
.then((response) => setServiceData(response));
}, []);

useEffect(() => {
const params = new URLSearchParams(window.location.search);
const show = params.get('show');

if (show !== null && buildingPointData) {
let results = buildingPointData!.features.filter((e: any) =>
e!.properties!.BldgNum.toLowerCase() === show.toLowerCase());

if (results.length > 0) {
onSearchResultClick(results.pop()!);
}
}
}, [buildingPointData])

const defaultLayoutProps: any = {
'icon-allow-overlap': true,
'text-field': ['get', 'Name'],
Expand Down

0 comments on commit 17fb5fe

Please sign in to comment.