-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: highlight and animate feature(s) by ID #1176
Conversation
✅ Deploy Preview for eoxelements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition, thanks! Fine for me to add this now, and add an issue that deprecates the panIn
property for v2.x
Could we just add a story for this functionality? I'll see if I find time for this today, otherwise any other volunteers welcome 😃
I added a story showcasing this: Screencast.from.2024-08-05.15.01.52.webm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me also looks good, not using it right now in any application, so probably good to see if @StefanBrand has feedback?
thanks @silvester-pari, this story is indeed a very good showcase of this feature |
About the |
This PR implements animations for programmatic feature selection for both VectorLayer and VectorTileLayer without causing a version jump of the map element.
The internally used
panIntoFeature
function has been lifted to the level of the interaction, exposing it the same way as thehighlightById
function as a method of the interaction itself.The existing
highlightById
-method now has an optional second parameter,fitOptions
, allowing animations to highlighted Features ofVectorLayer
and RenderFeatures of aVectorTileLayer
. Be aware that when programmatically selecting a feature, the source has to be loaded, and, in the case of theVectorTileLayer
, the feature has to be available in currently rendered tiles. ThefitOptions
also include convenient properties likepadding
ormaxZoom
.This is designed as convenience-functionality for the
select
-Interaction, as an improvement of the existinghighlightById
method. Arguments could be made for thepanIn
-flag to be replaced completely byfitOptions
, in order to have more control over animations (this is currently static withduration: 750
and no padding), but this would mean a version jump.#570
#1097
Screenshots/Videos
Checklist before requesting a review