Hi, I see the Geofield is attached to using the Addressfield module for Address info as of this explanation; https://www.drupal.org/node/2565163. Could that please be a loosely coupled interface?

I have Geofield, but uses Locations module for Addressinfo. I would very much like to be able to select Locations instead of Addressfield as the module for the Address-information.

For other purposes I cannot move away from Locations module. So it would be great if Geofield could be looking for Locations info instead Addressfield info by using a setting somewhere.

Thanks for considering this. And if this is not the correct place for this enhancement, please tell me, then I will add a new issue.

Greetings, Martijn

Comments

Summit created an issue.

hutch’s picture

I cannot follow what you are trying to do, however I can tell you that Getdirections supports the following modules, in this order:
'getlocations_fields',
'geofield',
'geolocation',
'location_node',
'location_cck'

see function getdirections_supported_modules() on line 2025 in getdirections.module

Summit’s picture

Hi,
Thanks for your quick reply!
I see it takes the Addressfield for filling the Route to info, when I set this to
for example http://www.hotels-onderweg.nl/getdirections/location/to/1233

But I would very much that it takes the Location module address information, which I also fill in.
For example the address info in http://www.hotels-onderweg.nl/movenpick-albergo-benjaminn.

Sorry if I was not clear enough.

Greetings, Martijn

Summit’s picture

Hi,

I see in code in getdirections_fields.module Geofield is attached to address:

elseif ($module == 'geofield') {
        if ($location = $entity->{$locative_field_name}[$lang][$delta]) {
          $latlon = $location['lat'] . ',' . $location['lon'];
          $address_field_name = $item['address_field_name'];
          if ($address_field_name && isset($entity->{$address_field_name}[$lang][$delta])) {
            if ($addressfield = $entity->{$address_field_name}[$lang][$delta]) {
              $loc = _getdirections_addressfield_loadaddress($addressfield);
            }
          }
          if (! $loc) {
            $loc = t('This address');
          }
        }
      }

Could that please be build as such that also Location module still can be used?
Something like, If Address country is not filled and Location country is filled then..
Or a setting if Location is used instead of Address then..

Address doesn't show the Streetaddress for every country, because thats not build in, and will not build in by the module maintainers, as such I need to use Location to show the full address.

Thanks a lot in advance for considering the switch or a code example.

greetings, Martijn

hutch’s picture

Please read what I said in #2, if you want to change the order in function getdirections_supported_modules() on line 2025 in getdirections.module then go ahead and do that, I provide no guarantee that it will work. For me, it makes no sense to want more than one locative module, they inevitably clash but you choose to do so anyway.