You are here

function geocoder in Geocoder 7.2

Same name and namespace in other branches
  1. 7 geocoder.module \geocoder()

The Geocoder API call.

Given one or more plugin id(s), geocode the given data.

@example: geocoder('googlemaps', '1600 Amphitheatre Parkway Mountain View, CA 94043'); geocoder(array('freegeoip', 'googlemaps'), '8.8.8.8');

@codingStandardsIgnoreStart

Parameters

string|string[] $plugin_ids: The geocoder plugin id(s) to use.

string $data: Data to be passed into the handler for geocoding. For example a address string.

array $options: Additional options to pass to the handler. Exact key / values to pass depend on the handler. (Optional)

Return value

mixed \Geocoder\Model\AddressCollection|FALSE

1 call to geocoder()
geocoder_field_widget_get_field_value in modules/geocoder_field/geocoder_field.module
Get a field's value based on geocoded data.
5 string references to 'geocoder'
Geocoder::log in src/Geocoder.php
Log a message in the Drupal watchdog and on screen.
geocoder_field_field_attach_presave in modules/geocoder_field/geocoder_field.module
Implements hook_field_attach_presave().
geocoder_field_field_widget_settings_form in modules/geocoder_field/geocoder_field.module
Implements hook_field_widget_settings_form().
Random::geocode in src/Plugin/Geocoder/Provider/Random.php
Geocode data
Random::reverse in src/Plugin/Geocoder/Provider/Random.php
Reverse geocode latitude and longitude.

File

./geocoder.module, line 32
Module file for Geocoder module.

Code

function geocoder($plugin_ids, $data, array $options = array()) {
  if ($value = \Drupal\geocoder\Geocoder::geocode($plugin_ids, $data, $options)) {

    // @codingStandardsIgnoreEnd
    return $value;
  }
  return FALSE;
}