Is there a way to have Location pick the appropriate country based on the latitude/longitude entered when the node is saved?

  • To which Drupal version are you interested? – kiamlaluno May 11 '11 at 6:58
  • Good question! D6. – DanH May 11 '11 at 16:36

I believe Location has the ability to be added with a CCK field. The coords can then be converted into a long address. From there you should be able to pull out the country.

If you want to get even fancier you can use OpenLayers to show the location on a map. Does that answer your question?

  • That is more or less right, you will need to make sure location has access to one of the geocoders for this to work. – Jeremy French May 13 '11 at 15:33
  • Well it's part of a large existing project where converting Location to CCK isn't going to happen, but if it's possible with how you say, then I suppose it's not a far cry from a custom module. Thanks :D – DanH May 13 '11 at 16:31
  • So you already have existing location data? – MikeNGarrett May 17 '11 at 23:42
  • Yes there's already a ton of nodes with coordinates input, but the editors are pretty lazy and never both to input the address properly and sometimes they don't even select the correct country. I'm trying to use the address data for google rich snippets ultimately. OpenLayers looks like the way forward though, I'll try and push that :) thanks! – DanH May 26 '11 at 4:28

Your Answer

