How do I add geolocation to the Multi Location Widget?

Options
John_P
John_P Member Posts: 2

I'm trying to add geolocation functionality to the Multi Location Widget so that a user sees the closest store location to their area based on their location settings. I'm very new to Duda. So any simple walkthrough would be very much appreciated.

Thank you in advance!

Best Answer

  • Thomas_Connery
    Thomas_Connery Member Posts: 226 MVP
    Answer ✓
    Options

    The multi location content widget will automatically support the visitor in finding the closest location to them if they have location services enabled on their device or browser. I just did a test on this capability and it worked perfectly. Simply click the 'Find Nearest Location' button to execute the lookup once you have your locations added.

    You can find other details here about the widget here: https://support.duda.co/hc/en-us/articles/4410652611607-Multi-Location-Widget

Answers

  • John_P
    John_P Member Posts: 2
    Options

    Thanks Thomas!

    Is there a way to have it default to show the nearest location without the use of the button? Just wondering if that is possible and what code would need to be added for location lookup based on a user allowing location permissions.

  • Thomas_Connery
    Thomas_Connery Member Posts: 226 MVP
    Options

    Not that I'm aware of John. I believe it waits for the input from the user. Someone else may have a solution though. It's a good question and I agree that defaulting to the user's location in the browser to run an initial or automatic search would be a nice option.