TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.07k stars 1.19k forks source link

Geospatial Plugin: Improve Event Support #8740

Closed Jermolene closed 1 week ago

Jermolene commented 1 week ago

This PR extends the geospatial plugin as follows:

github-actions[bot] commented 1 week ago

Confirmed: Jermolene has already signed the Contributor License Agreement (see contributing.md)

netlify[bot] commented 1 week ago

Deploy Preview for tiddlywiki-previews ready!

Name Link
Latest commit 717cce58bee4f30050df2d9d746b5081e4972d43
Latest deploy log https://app.netlify.com/sites/tiddlywiki-previews/deploys/67373870c497b00008419352
Deploy Preview https://deploy-preview-8740--tiddlywiki-previews.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

ericshulman commented 1 week ago

For consistency with other widgets that perform "side-effect" actions when clicked or changed (e.g., $button, $checkbox, $select, $range, etc.), I think the parameter should be named "actions=..." rather than "onclick".

Also, in addition to the properties object, I will also need the coordinates object for the marker that is clicked upon so that I can use the latitude and longitude values to update the map state so I can center the map on the marker.

Jermolene commented 1 week ago

For consistency with other widgets that perform "side-effect" actions when clicked or changed (e.g., $button, $checkbox, $select, $range, etc.), I think the parameter should be named "actions=..." rather than "onclick".

We've already got an "updateActions" attribute on the <$geolayer> widget, so I've renamed "onclick" to "clickActions" for consistency.

Also, in addition to the properties object, I will also need the coordinates object for the marker that is clicked upon so that I can use the latitude and longitude values to update the map state so I can center the map on the marker.

Apologies the docs were missing but the click actions do actually also get the variables lat, long and alt with the coordinates of the marker.

Jermolene commented 1 week ago

Hi @ericshulman I've fixed the issue with the default popup template being used in the clickActions demo. Let me know how you get on.