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

Conforming searchByPlaceId to return type MaplibreGeocoderPlaceResults causes error #162

Open
tomhuze opened this issue Sep 24, 2024 · 2 comments · May be fixed by #163
Open

Conforming searchByPlaceId to return type MaplibreGeocoderPlaceResults causes error #162

tomhuze opened this issue Sep 24, 2024 · 2 comments · May be fixed by #163

Comments

@tomhuze
Copy link

tomhuze commented Sep 24, 2024

searchByPlaceId return type MaplibreGeocoderPlaceResults is an object with a "place" property with a value of an array of CarmenGeoJSON features:

type MaplibreGeocoderPlaceResults = {
    place: CarmenGeojsonFeature[];
};

in index.ts line 919 this array is wrapped in another array:
results = [res.place];
This causes an error to be thrown when the user selects a place from the results, and the map is not moved to the selected place as is expected.
Either place in the MaplibreGeocoderPlaceResults type needs to be updated to accept a single feature, or res.place should not be wrapped in an array in index.ts line 919.

@HarelM
Copy link
Collaborator

HarelM commented Sep 24, 2024

Feel free to submit a PR with the relevant fix, reverse engineering the types was hard and I probably did some mistakes...

@tomhuze tomhuze linked a pull request Sep 25, 2024 that will close this issue
1 task
@tomhuze
Copy link
Author

tomhuze commented Sep 25, 2024

Thanks! PR is here: #163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants