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

Calculate coordinates and bbox from feature #351

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

jblanchg
Copy link
Contributor

@jblanchg jblanchg commented Feb 4, 2025

Hi!

With the SearchBox and Search providers reworks our custom search provider stop working, I added this fix to calculate the marker coordinates and the bbox from the feature if the 'item' does not have it.

@manisandro
Copy link
Member

Is your search provider/backend able to return the search center / bbox directly in onSearch, or only when fetching the geometries via getResultGeometry?

@jblanchg
Copy link
Contributor Author

jblanchg commented Feb 4, 2025

I can get the geometry for the item only via getResultGeometry

@manisandro
Copy link
Member

What about adding center and bbox to the getResultGeometry response, and using those instead if item.{x,y,bbox} if defined? I.e.

CoordinatesUtils.reproject(response.center ?? [item.x, item.y], item.crs ?? this.props.map.projection, this.props.map.projection)

and

let bbox = response.bbox ?? item.bbox ?? [item.x, item.y, item.x, item.y];

?

@jblanchg
Copy link
Contributor Author

jblanchg commented Feb 5, 2025

Hi! I added bbox and center to the getResultGeometry if defined

@manisandro manisandro merged commit cb3472c into qgis:master Feb 5, 2025
2 checks passed
@manisandro
Copy link
Member

Thanks

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 this pull request may close these issues.

2 participants