4
2 Comments

How to add a location tagging feature for social network

I am working on a MERN stack social network that allows people to tag their posts to a certain location. This is basically like Facebook, Instagram or Airbnb. Users searching for a certain location should see all the posts tagged to that location. I want users to be able to search for a country, city, store, landmark, hotel etc. and be able to see all the posts tagged to that location.

I used Google Places API for this at first. When a user upload a post, he/she can select a location from Google Autocomplete, and the address of that location will be stored in my database along with the other post details. When another users searches for a location, that location's address will be sent in an API call to see if any posts have that matching address, and return them.

I almost completed it when I found out that Google doesn't allow you to store any addresses or any other info. They allow only place ID, but they say that can change over time. So, I can't tag posts with it.

I looked further into other solutions like Mapbox but you can only store their data if you buy places.permanent I think. But that doesn't have "Points of Interests" such as landmarks and stores.

How can I add this feature to my network? Is there any way a solo coder can do this with Google maps/ places, Mapbox or OpenStreetMap or any other technology? Thank you in advance!

on July 4, 2021
  1. 2

    Have you tried Algolia Places?
    I recommend you to take a look.

    https://github.com/algolia/places

    Regards

    1. 1

      Thanks for your reply. Algolia is being deprecated next year. So I don't think it will work