Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Map Search Component #17

Closed
toreylittlefield opened this issue Mar 19, 2023 · 1 comment · Fixed by #38
Closed

Create Map Search Component #17

toreylittlefield opened this issue Mar 19, 2023 · 1 comment · Fixed by #38
Assignees
Labels
enhancement New feature or request

Comments

@toreylittlefield
Copy link
Collaborator

image

image

image

image

Map Search Component with a dropdown for the search results (autocomplete). Some call it a combobox.

For now let's just use mock data. It doesn't need to you can use static coordinates and the map will navigate to that location. In the future we'll implement an api for the search results like openstreetmaps api.

Use Hero Icons. All icons are Hero Icons.
https://heroicons.com/

Figma File for Design Spec
https://www.figma.com/file/1JldbWl3Pe6fir7V3aMotw/Pet-Poison-Alert-Figma-Design?node-id=9%3A353&t=5DE50BmBomMhd8an-1

@toreylittlefield toreylittlefield added the enhancement New feature or request label Mar 19, 2023
@Netdreion Netdreion self-assigned this Mar 22, 2023
@toreylittlefield
Copy link
Collaborator Author

@Netdreion as discussed the mock data could be something like this for now. It's up to you. After this ticket we'll create a new issue to use some free api to autocomplete the search input with a fetch.

const mockSearchLocationData ={
    "results": [
        {
            lat: 40.7128,
            lng: -74.0060,
            name: "New York, NY, USA",
        },
        {
            lat: 37.7749,
            lng: -122.4194,
            name: "San Francisco, CA, USA",
        },
        {
            lat: 34.0522,
            lng: -118.2437,
            name: "Los Angeles, CA, USA",
        },
        {
            lat: 41.8781,
            lng: -87.6298,
            name: "Chicago, IL, USA",
        },
    ]
}

// function to get the location data with autocomplete
function getSearchLocationData(searchText) {
    const results = mockSearchLocationData.results.filter((result) => {
        return result.name.toLowerCase().includes(searchText.toLowerCase());
    });
    return results;
}

toreylittlefield added a commit that referenced this issue May 27, 2023
* Co-authored-by: Torey Littlefield <toreylittlefield@users.noreply.github.com>

* searchbar compenent

* searchbar compenent

* LocationSearch

* remove node modules in packages/client

* update packages and fix root package.json

* move eslint install to root package.json

* made changes accordinly

* search bar update

locationsearch updated with the suggestions recieved

* fix import BottomNav compile error

---------

Co-authored-by: Torey Littlefield <52614742+toreylittlefield@users.noreply.github.com>
@toreylittlefield toreylittlefield linked a pull request May 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants