Skip to content

Commit

Permalink
GO-852 implemented separate options for reverse geocoding (#79)
Browse files Browse the repository at this point in the history
* GO-852 implemented different options for reverse geocoding

* GO-852 fixed issues with types/limit

* improved react sample

* updated options documentation

* updated documentation
  • Loading branch information
zdila authored Jan 8, 2025
1 parent 0435e1a commit e44c888
Show file tree
Hide file tree
Showing 7 changed files with 572 additions and 433 deletions.
19 changes: 17 additions & 2 deletions examples/react/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function App() {

const [collapsed, setCollapsed] = useState(false);

const [reverse, setReverse] = useState<EnableReverse>("never");
const [reverse, setReverse] = useState<EnableReverse>("always");

const [clearOnBlur, setClearOnBlur] = useState(false);

Expand Down Expand Up @@ -85,7 +85,7 @@ function App() {
dataDiv.appendChild(document.createTextNode(JSON.stringify(data)));
el.appendChild(dataDiv);

(el.parentElement as HTMLDivElement).scrollTo(0, el.scrollHeight);
el.parentElement?.scrollTo(0, el.scrollHeight);
}

return (
Expand Down Expand Up @@ -119,6 +119,8 @@ function App() {
enableReverse={reverse}
flyToSelected={flyToSelected}
selectFirst={selectFirst}
// reverseGeocodingLimit={5}
// reverseGeocodingTypes={["address"]}
/>
)}

Expand Down Expand Up @@ -215,6 +217,19 @@ function App() {

<div className="row flex-grow">
<div className="col-6 card flex-grow overflow-auto">
<div>
<b>Logs</b>&emsp;
<button
type="button"
className="is-small"
onClick={() =>
consoleRef.current && (consoleRef.current.innerText = "")
}
>
Clear
</button>
</div>

<div className="logs" ref={consoleRef} />
</div>

Expand Down
5 changes: 5 additions & 0 deletions examples/react/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ main {
select {
margin-right: 2ex;
}

button.is-small {
padding: 4px 8px;
font-size: 0.8em;
}
Loading

0 comments on commit e44c888

Please sign in to comment.