I'm trying to recreate a site, and one part of the content is supposed to show the distance relative to the user's location, like this:

enter image description here

Does anyone know of a way I can accomplish this?


You need to install the Geolocation Field module and the example submodule that comes with it.

In the examples you will find a view that made exactly what you need, and you only will need to clone and edit the view.

Geolocation Field provides a field type to store geographical locations as pairs of latitude and longitude (lan,lng). The Drupal 8 version also provides a views proximity search plugin. Geolocation Field can be used with all fieldable entities like nodes, users, comments, taxonomy terms, etc.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.