function geofield_data_property_info in Geofield 7
Same name and namespace in other branches
- 7.2 geofield.schemaorg.inc \geofield_data_property_info()
Defines info for the properties of the geofield field data structure.
1 call to geofield_data_property_info()
- geofield_property_info_callback in ./
geofield.module - Callback to alter the property info of geofield fields.
File
- ./
geofield.module, line 465
Code
function geofield_data_property_info($name = NULL) {
// Build an array of basic property information for the geofield field.
$properties = array(
'wkt' => array(
'label' => 'Well-known text',
'type' => 'text',
),
'geo_type' => array(
'label' => 'Geo Type',
'options list' => '_geofield_geo_types_options_callback',
'required' => TRUE,
),
'lat' => array(
'label' => 'Latitude',
'type' => 'decimal',
'required' => TRUE,
'setter callback' => 'entity_property_verbatim_set',
),
'lon' => array(
'label' => 'Longitude',
'type' => 'decimal',
'required' => TRUE,
'setter callback' => 'entity_property_verbatim_set',
),
'left' => array(
'label' => 'Left Latitude',
'type' => 'decimal',
'setter callback' => 'entity_property_verbatim_set',
),
'top' => array(
'label' => 'Top Longitude',
'type' => 'decimal',
'setter callback' => 'entity_property_verbatim_set',
),
'right' => array(
'label' => 'Right Latitude',
'type' => 'decimal',
'setter callback' => 'entity_property_verbatim_set',
),
'bottom' => array(
'label' => 'Bottom Longitude',
'type' => 'decimal',
'setter callback' => 'entity_property_verbatim_set',
),
'srid' => array(
'label' => 'Projection (SRID)',
'type' => 'integer',
),
'latlon' => array(
'label' => 'LatLong Pair',
'type' => 'string',
'getter callback' => 'geofield_return_latlon',
),
);
// Add the default values for each of the geofield properties.
foreach ($properties as $key => &$value) {
$value += array(
'description' => !empty($name) ? t('!label of field %name', array(
'!label' => $value['label'],
'%name' => $name,
)) : '',
'getter callback' => 'entity_property_verbatim_get',
);
}
return $properties;
}