Location: associate geographic location

Last modified: March 8, 2009 - 19:55

The location module allows you to associate a geographic location with content and users. Users can do proximity searches by postal code. This is useful for organizing communities that have a geographic presence.

To administer locative information for content, use the content type administration page. To support most location enabled features, you will need to install the country specific include file. To support postal code proximity searches for a particular country, you will need a database dump of postal code data for that country. As of June 2005 only U.S. postal codes are supported.

A database dump for most countries postal codes can be downloaded from GeoNames. The current full URL for the downloads page is http://download.geonames.org/export/dump.

You can

  • administer locative information at administer >> content types to configure a type and see the locative information.
  • administer location at administer >> settings >> location.
  • use a database dump for a U.S. postal codes table that can be found at zipcode database.
  • enable a CiviCRM profile with street address, supplemental address 1, city, postal code, state, and country that will be synchronized between CiviCRM and the location module.
  • file issues, read about known bugs, and download the latest version on the Location project page.

you will need to install the country specific include file

mansspams - October 17, 2008 - 19:57

What is "country specific include file" and where can I get it?

The module's "supported" sub

daneyuleb - October 28, 2008 - 13:14

The module's "supported" sub folder contains country specific inc files. So...are these already being picked up by the module, or should needed one's go somewhere else? (a little unclear from the above text). If they are picked up automatically, then it would seem the step of installing the inc file is unnecessary in the vast majority of cases.

Yes, this is confusing

wanderingstan - November 30, 2008 - 04:30

Just to agree with the above comments. I can't figure out what I'm supposed to install. Seems the module should recognize if needed files are missing and alert the user.

The module looks great, just can't figure out how to get started.

Lost in georeference

cmaggi77 - December 5, 2008 - 09:34

Hi all,

I'm a little bit lost... I can't understand how to make it work for countries that doesn't have any external map link to get the latitude and longitude in function of its name?
Does anyone know what I should do in order to be able to locate, for instance, Caracas in Venezuela, using the location module?
Thanks in advanced!

Is Location ready for i18n?

cloneofsnake - December 27, 2008 - 09:48

Found this rather negative review of the Location module here:

http://civicactions.com/blog/Location_Package_Drupal_6

For most common requirements -- especially multi-lingual sites -- the Location package is not a good solution for locative data in Drupal 6.

Thought it may be useful for the community to know about these issues and give the development team a chance to explain themselves here. Now, if someone is in the midst of developing a multilingual site that will require location information, should he/she NOT use the Location module? Is what was said in this article still valid for version 3 of the Location module?

User locations

dbr - February 1, 2009 - 04:15

I didn't see this documented anywhere: if you want users to be able to set their location, you need to enable it in admin/user/settings (in addition to giving them the permission to do it).

Installation problems

span - February 11, 2009 - 22:03

Not really sure on how to get this to work with maps. Anyone who installed sucessfully might be able to post more detailed instructions?

Location and users

DocMartin - March 5, 2009 - 13:23

Seeing above not answered, I'll give some notes, as have Location working for users and nodes - for users, only after seeing post re settings.

Using both GMap and Location modules; only very basic usage of them, but some things working.
Both are enabled; under Site Configuration, visited GMap - where main thing seems to be adding Google Maps API key for website, and saving. [Can make other changes, for default map that will appear when use GMap macro]

For GMap Location, I enabled Google Map API geocoding; maybe not helpful for me yet. Plus set a few other things, but not vital to do so. Useful to set the default maps, to suit your likely user base and, perhaps, likely range of articles on site.

For Location, I enabled the display of locations - would seem, then, this is important step. Chose option to use google map to set latitude and longitude: really useful thing to do. Map Links and Geocoding not vital for getting basic functionality, I've discovered.

Then, User management - user settings, and at the bottom [for me] there's chance to choose re Location settings for each user. Maybe here crucial to change maximum number of locations from 0 - it's not like some options in Drupal where "0" rather oddly stands for unlimited. Perhaps just 1 would be ok, unless for quirky users who are typically in several places. Might also choose 1 for minimum, if want to require users to add location.
Here, too, there are further options, but maybe more a matter of taste than crucial for getting location working.

In doing the above, I found items automatically added to navigation menu - linking to Node locations, User locations; and to GMap macro builder.

Finally...

riccardorb - March 28, 2009 - 02:16

I had been trying for over a week, just to get the User Locations running and I thought I was going crazy. But indeed: don't forget to put the MAXIMUM NUMBER of locations to more than 0!
Thanks for the reminder DocMartin :)

Zipcode database dump

Bartels - March 12, 2009 - 20:24

Forgive my ignorance, but how does one incorporate the database dump?

Import the data into your database

packdragon - March 27, 2009 - 22:07

In my case, I used phpMyAdmin to import the data into my database. It was very simple. Whatever user interface you use to interact with your database, use that to import the data from the .mysql file. I can't get more specific than that because I don't know what your setup is.

I dont know what the deal is

kevster111 - May 2, 2009 - 18:15

I dont know what the deal is but I can't get the proximity search to work at all an the markers don't appear on anything. Has anyone else had similar issues and if so possible reasons.

oh and ive added the zip

kevster111 - May 2, 2009 - 18:17

oh and ive added the zip codes to the database, for the U.S. for right now will add more if I can get them to work

Display of content depending on user location?

plan9 - June 18, 2009 - 20:34

Will this module allow displaying content depending on the users location?

Location search by zip

tonebari - June 24, 2009 - 17:30

I am looking to return results in a module for a distance query by zip. Here is my question: Is there a stored procedure already installed to return locations within a distance from a zip? If so, how do I leverage this using a form-submitted zip and distance? Thank you so much.

 
 

Drupal is a registered trademark of Dries Buytaert.