Steffanic / streamlit-geolocation

A geolocation button for streamlit
MIT License
10 stars 0 forks source link

Way to call directly without crosshair click? #2

Open emigre459 opened 7 hours ago

emigre459 commented 7 hours ago

Love this tool, thanks for pulling it together for such a handy use case! One thing I'd love to be able to do is trigger the call for a geolocation data pull simply by calling streamlit_geolocation() instead of having that call spawn the crosshair icon that then needs to be clicked by the user (so I can style my own button for them to click directly for the desired find-my-location effect). Is there a straightforward way to do that with your package?

Steffanic commented 5 hours ago

Thank you for the kind words! I never thought anyone would use this. 😅 Are you asking to choose your own icon, or to extract the geolocation logic? The first one may be straightforward. As I'm using FontAwesome icons, it should be straightforward to add an icon string prop. As for extracting the functionality, it's critical that this is called only by user request. I'd need to know more about what you are trying to do. I'll think on it and take a look when I get to my computer.