It would be a nice feature to ignore the "Additional Address" field from Location Module during the "Find Address on Map" or when saving the node.

The issue encountered is that the additional address is needed, but should be ignored, but included as part of the location, but not the mapping process.

For example, we are including a PO Box as an additional address. The PO Box causes mapping issues because it is trying to locate. If not filling in the additional address field in finds the location accurately based on Street Address.

I'm not sure whether to post here or at Location Module.

Example:

This map is accurate

5337 Hwy 264 East
Washington
North Carolina
27889

and so is this one...

5337 Hwy 264 East
PO Box 1096
Washington
North Carolina
27889

but not this one because Post Office Box is spelled out.

5337 Hwy 264 East
Post Office Box 1096
Washington
North Carolina
27889

There are other instances where we use a Suite # and sometimes get random locations generated. A checkbox to ignore that field would be a great feature. Or in the drop down selection list, the option to "Collect but Ignore for Mapping" possibly?

CommentFileSizeAuthor
#1 gmap_location-2157629-1.patch5.14 KBalcroito
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alcroito’s picture

Version: 7.x-2.7 » 7.x-2.x-dev
Status: Active » Needs review
FileSize
5.14 KB

I'm pretty sure this will need some additional fixes, and the UI still has to be implemented, but attaching a patch that allows you to alter which address parts will be used for geocoding, by implementing a pseudo-JS hook, in your custom admin theme JS file.

You need to add a JS event handler for the 'location_gmap_find_address.address_parts_alter' event. This is a JS-way of doing drupal_alter().
Check out an example in the location_gmap_find_address.api.js file.

Feel free to expand the patch to add a UI component.

  • podarok committed 43a9db6 on 7.x-2.x authored by Placinta
    Issue #2157629 by Placinta: Gmap + Location Additional Address Field,...
podarok’s picture

Status: Needs review » Fixed
Issue tags: +API addition

let's have this into upcoming release candidate

Please, extend change notice with an example of how to use new api https://www.drupal.org/node/2423651

Thanks in advance

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.