How to use Geo-location in a website?


I want to add the geolocation code in my Website but I want this code to filter out the data according to the user location for example when the user allows access to share their location it should present the data to them for their nearest location like this website BookMyShow. In this website, it will give the details about the theater which are nearest to my current location


mdn has some great documentation about geo-location: mdn - geolocation

You can implant this in your website, there is even a working example