carbonplan / maps

interactive multi-dimensional data-driven web maps
https://maps.demo.carbonplan.org
Other
213 stars 18 forks source link

add touch event listeners to region picker #106

Closed Shane98c closed 9 months ago

Shane98c commented 9 months ago

This PR adds touch event handlers to the region picker so that we can move/resize on mobile.

Ran into an issue where the touchmove events weren't fired after initiating the listeners in touchstart, so went with a pattern I've seen elsewhere of 'activating' the element before allowing the interaction. I added a style change (stroke increase) to indicate this state change. The handle accomplishes the same effect for free with the radius values showing so I left that alone.

vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **maps-demo** | ⬜️ Ignored ([Inspect](https://vercel.com/carbonplan/maps-demo/FvZ4FhEqwyLbwN4q7FVaLUCxSQpT)) | [Visit Preview](https://maps-demo-git-mobile-region-picker-carbonplan.vercel.app) | | Feb 23, 2024 7:40pm | | **maps-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/carbonplan/maps-docs/CgnqoUhpBgwDQxA17XehSJCbdy9b)) | [Visit Preview](https://maps-docs-git-mobile-region-picker-carbonplan.vercel.app) | | Feb 23, 2024 7:40pm |