3

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

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

1 Answer 1

2

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?

4
  • That is more or less right, you will need to make sure location has access to one of the geocoders for this to work. May 13, 2011 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, 2011 at 16:31
  • So you already have existing location data? May 17, 2011 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, 2011 at 4:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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