You are here

function hook_farm_map_entity_geometries in farmOS 7

Extract geometries from an entity.

Parameters

$entity_type: The entity type machine name.

$entity: The entity object.

Return value

array Return an array of geometry strings in WKT format. An associative array is allowed, and the keys can be used to differentiate multiple geometries from the same entity.

Related topics

2 functions implement hook_farm_map_entity_geometries()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

farm_map_farm_map_entity_geometries in modules/farm/farm_map/farm_map.module
Implements hook_farm_map_geometries().
farm_movement_farm_map_entity_geometries in modules/farm/farm_movement/farm_movement.module
Implements hook_farm_map_entity_geometries().
1 invocation of hook_farm_map_entity_geometries()
farm_map_entity_geometries in modules/farm/farm_map/farm_map.module
Extract geometries from an entity.

File

modules/farm/farm_map/farm_map.api.php, line 80
Hooks provided by farm_map.

Code

function hook_farm_map_entity_geometries($entity_type, $entity) {
  $geometries = array();

  // Find geometry in the standard geofield.
  if (empty($entity->field_farm_geofield[LANGUAGE_NONE][0]['geom'])) {
    $geometries[] = $entity->field_farm_geofield[LANGUAGE_NONE][0]['geom'];
  }
  return $geometries;
}