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

H3-JS binning resoluion in OpenLayers #177

Closed
sharmapn opened this issue May 5, 2023 · 1 comment
Closed

H3-JS binning resoluion in OpenLayers #177

sharmapn opened this issue May 5, 2023 · 1 comment

Comments

@sharmapn
Copy link

sharmapn commented May 5, 2023

I am focusing on this example: https://observablehq.com/@nrabinowitz/h3-tutorial-using-point-layers?collection=@nrabinowitz/h3-tutorial. I have implemented this h3-js example in openlayers in my front end application without any nodejs. Example is here https://jsbin.com/nosoyonemi/edit?html,output

The above jsbin example was in response to create a openlayers version of this mapbox example: https://gis.utah.gov/developer/applications/suitability/ and https://github.com/agrc/gis.utah.gov/tree/master/developer/applications/suitability

However, I would like the user to choose the h3 resolution also, i.e. the SIZE of the hexagons - just as the option given in the original observablehq example. On the observablehq example's page, on the right, three dots, there is an option to Export and Download Code. However, after going through the code, I have not been able to find the code that changes the h3 resolution as per slider value.

The jsbin example provides similar functionality, but is missing the essential feature of allowing the user to choose the h3-resolution, i.e. the size of the hexagons. Instead, the example focuses on aggregating the number of points in the chosen layers. I would be glad if someone could guide me on how to proceed, as I could not find any resources online.

@nrabinowitz
Copy link
Collaborator

The JSbin example looks good! But this isn't really an h3-js issue, just a web programming issue. You have a config object that hard-codes the h3Resolution to 8. You just need to add another slider or other input that allows the user to set this value and recalculate the rest of the data based on that change. StackOverflow might be a better place to ask than this repo.

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

No branches or pull requests

2 participants