2

Drupal 6, Views 2

I'm using the Location module to store address information for various contacts in nodes. I am then using the Views module along with the GMap sub-module of Location to display these nodes as map markers on a Google Maps style map on a page in my site.

This works perfectly for USA addresses, but I can't get Canada or UK addresses to display on the node map. The link inside the node (from Location module) to view the location in an external Google Map works just fine, so I can confirm the addresses are valid. However, they do not display on my Drupal Views generated Google Map a la Location/GMap.

Note - disabled and/or cleared cache to make sure this wasn't an issue. Also Regenerated marker cache inside of Location configuration to rule that out also.

Is there some kind of configuration setting I'm missing?Screenshot of my geocoding setting, showing I enabled for Canada.

2
  • Off the top of my head, I'd look at admin/settings/location/geocoding and make sure you've selected google for Canada and the UK.
    – Jimajamma
    Sep 4, 2012 at 21:55
  • I added a screenshot showing that I have enabled Canada in the Geocoding section like you mentioned. It was one of the first things I looked at. Thank you Sep 4, 2012 at 22:04

2 Answers 2

1
+100

I can confirm that it is possible to get locations and GMAP running on Drupal 6 for Canadian addresses. I have done this on more than one occasion.

From your description it simply sounds some setting preventing the reverse geocoding of addresses. Edit one of your nodes with canadian addresses and confirm that the Lat and Lon field are empty. Save then edit again and confirm it is still empty.

If the lat/lon fields are empty try the following

  1. Make sure you have a valid google maps API key for the URL you are running the site under.
  2. Confirm that the location module has access to this API keys. Reverse geocoding settings for locations module is under /admin/settings/location/geocoding go to Canada and click "Configure parameters" screen capture of configure parameters
    Or go there directly: /admin/settings/location/geocoding/ca/google

    Your Gmap google map api key should be displayed.
  3. Confirm that as a user you have permission to save lat/long info. Under user permissions (/admin/user/permissions) go to "location module" and check that "submit latitude/longitude" is selected for users that will be creating the nodes with address information. If not then there will be no reverse geocoding for any address, Canadian or otherwise.
  4. Once you have confirmed the above, revisit a node with a Canadian address. Edit and hit save. This will re-run the reverse geocoding. If a lat/long is not saved then I will have to do some more digging. Also if you have lots of nodes in need of reverse geocoding, it is possible to do this programmatically.
  5. Are you using CCK field or location module itself to save the address and lat/on? I am uncertain whether or not reverse geocoding works with the cck location field in D6.
7
  • Thanks for the excellent troubleshooting. Still not working, here is my feedback. I have an API key, how do I confirm that it is valid? I assume it is since it resolves USA addresses. The API key is displayed for the Canada Google Geocoding config page. I have confirmed that all user roles have "submit latitude/longitude - location module" checked. I went to one of my Canada nodes, and confirmed that there is no Lat/Long info, I edited the node and saved, and still no Lat/Long info was input into the Location fields. Field = Locations - Node Locations module form. Sep 5, 2012 at 16:27
  • Conversely, one of my test USA nodes does have the Lat/Long coordinates in the appropriate fields on the node, and it does display correctly on my map. So, the problem is how do I get my Canada/UK nodes to populate the Lat/Long fields automatically like the USA ones do. Sep 5, 2012 at 16:29
  • 1
    @DavidCsonka - an manually enter the lat/lon (use map.google.com) on a Canadian node and have it show up on your map? For example the lat/ lon coordinates 49.268033, -123.147000 should put you just outside of downtown Vancouver in the Kitsilano neighbourhood.
    – Rider_X
    Sep 5, 2012 at 16:56
  • 1
    @DavidCsonka - Beyond that I think I would need to login to troubleshoot. It has to be some innocuous setting.
    – Rider_X
    Sep 5, 2012 at 17:01
  • 1
    @DavidCsonka - Yes there are some oddities with the location module and that was one I forgot. The real rub, is if you look at the fields available (devel module) you will see that it does know about province abbreviation. Glad I could help
    – Rider_X
    Sep 5, 2012 at 17:29
1

Hi there is a table in drupal which stores locations postal code.

The name of the table you should look is for drupal.zipcodes

Now, you need to import Canada's zipcode sql dump to this zipcode table.

Once you have imported the codes, refresh the cache and then create content and it should display Canada's location nodes.

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.