Tour of code changes outside of the main Gimme component:
Added more types to cover the common case of undefined | LatLng and implemented where needed for that to work
Moved latLng to a new placesStore (the "default" store feels to me like an ItemStore).
This PR doesn't attempt integration within any Item components (because those will be significantly changed in parallel PRs), but I did make necessary code adjustments to get stuff to compile.
Intended behavior to test (go through these in order, with the Vue dev tools open showing the Places store).
Searching for a name provides a list; clicking a result or using arrow keys + Enter to select will assign the lat/lng and the community in the Places store.
After a place is selected, the control switches over to name the selected place, with a "Go back, pick another place" button. Clicking that button clears out data in the store.
Now enter a lat/lng. When the control recognizes that lat/lng is probably being entered, it shows a helper message. As soon as the lat/lng is parseable / valid, a button appears that lets the user click to select that lat/lng.
You can also enter a lat/lng outside the defined range (try 65, -120) and get an error message.
(there is one special case: 40 Mile Flats will match a community as well as the lat/lng parsing for a moment. Not a big deal.)
Not implemented: we can/should filter communities based on lat/lng. This can be done by implementing the searchEngine property of the autocompleter, but I wanted to get this merged earlier (should make a ticket for that).
Tour of code changes outside of the main
Gimme
component:undefined | LatLng
and implemented where needed for that to worklatLng
to a newplacesStore
(the "default" store feels to me like an ItemStore).Intended behavior to test (go through these in order, with the Vue dev tools open showing the Places store).
40 Mile Flats
will match a community as well as the lat/lng parsing for a moment. Not a big deal.)Not implemented: we can/should filter communities based on lat/lng. This can be done by implementing the
searchEngine
property of the autocompleter, but I wanted to get this merged earlier (should make a ticket for that).