Note that there are some explanatory texts on larger screens.

plurals
  1. POhandling geographic locations dynamically
    primarykey
    data
    text
    <p>I've built a website for vacation rentals and housing for rent. I've created a page where users can add locations themselves (up to 6 levels deep) but I have come across a problem. A user may add a location ie:</p> <p>North America -> United States -> California -> San Francisco</p> <p>Another user may arrive and add an area under SF which he assumes to be under SF ( say Silver Terrace ). Yet another user could add that same area but he would not look under SF and would add to be a brother node of SF</p> <p>North America -> United States -> California -> Silver Terrace</p> <p>So now we would have:</p> <p>North America -> United States -> California -> San Francisco -> Silver Terrace<br> North America -> United States -> California -> Silver Terrace</p> <p>which is of course a duplicate =/ I could tell the user adding Silver Terrace the second time that it already exists but the first user may have placed it incorrectly which causes a problem.</p> <p>Even if I were to not allow users to add locations and I would do it myself or limit it to a few users, it would still be very difficult to correctly add all locations.</p> <p>In other countries there also comes the question of including or not including the state/district/region and so on to be part of the path for locations...</p> <p>I've read quite a few posts about this but I can't wrap my head around a good solution.</p> <p>It is difficult to eliminate locations altogether because I use them for subdomains ie. san-francisco.example.com or california.example.com . Locations also allow users to browse by country/state/city/area/neighborhood/etc if a user doesn't want to (or can't) do so using a map.</p> <p>I don't think there is a perfect answer for this but if you've got some suggestions, please let me know. Thank you so much.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload