geolocation with a click on web page

Hello.
I want to have a button on a page to enable geolocation for major browsers. ( if someone wants to )
Any idea where to find some code for that.
Thanks a lot.