Skip to content

Commit e44c888

Browse files
authored
GO-852 implemented separate options for reverse geocoding (#79)
* GO-852 implemented different options for reverse geocoding * GO-852 fixed issues with types/limit * improved react sample * updated options documentation * updated documentation
1 parent 0435e1a commit e44c888

File tree

7 files changed

+572
-433
lines changed

7 files changed

+572
-433
lines changed

examples/react/main.tsx

+17-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function App() {
3333

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

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

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

@@ -85,7 +85,7 @@ function App() {
8585
dataDiv.appendChild(document.createTextNode(JSON.stringify(data)));
8686
el.appendChild(dataDiv);
8787

88-
(el.parentElement as HTMLDivElement).scrollTo(0, el.scrollHeight);
88+
el.parentElement?.scrollTo(0, el.scrollHeight);
8989
}
9090

9191
return (
@@ -119,6 +119,8 @@ function App() {
119119
enableReverse={reverse}
120120
flyToSelected={flyToSelected}
121121
selectFirst={selectFirst}
122+
// reverseGeocodingLimit={5}
123+
// reverseGeocodingTypes={["address"]}
122124
/>
123125
)}
124126

@@ -215,6 +217,19 @@ function App() {
215217

216218
<div className="row flex-grow">
217219
<div className="col-6 card flex-grow overflow-auto">
220+
<div>
221+
<b>Logs</b>&emsp;
222+
<button
223+
type="button"
224+
className="is-small"
225+
onClick={() =>
226+
consoleRef.current && (consoleRef.current.innerText = "")
227+
}
228+
>
229+
Clear
230+
</button>
231+
</div>
232+
218233
<div className="logs" ref={consoleRef} />
219234
</div>
220235

examples/react/style.css

+5
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ main {
4141
select {
4242
margin-right: 2ex;
4343
}
44+
45+
button.is-small {
46+
padding: 4px 8px;
47+
font-size: 0.8em;
48+
}

0 commit comments

Comments
 (0)