Hi,
I am trying to set a default value for the location field of a location element in a Drupal form. I have figured out how to set default values for all of the other fields (address, additional address, city, state, zip, country) but can't figure out how to set the actual location default. My code:
$settings = array(
'multiple' => array('min' => 0, 'add' => 1, 'max' => 1),
'form' => array(
'collapsible' => FALSE,
'collapsed' => FALSE,
'fields' => array(
'country' => array('collect' => 4, 'weight' => 14, 'default' => variable_get('location_default_country', 'us')),
'street' => array('collect' => 4, 'default' => $vanevents_node['address']),
'additional' => array('collect' => 4, 'default' => $vanevents_node['address2']),
'city' => array('collect' => 1, 'default' => $vanevents_node['city']),
'province' => array('collect' => 1, 'default' => $vanevents_node['state']),
'postal_code' => array('collect' => 2, 'default' => $vanevents_node['zip'] > 0 ? $vanevents_node['zip'] : ""),
'locpick' => array('collect' => 0),
'is_primary' => array('default' => 1),
),
),
);
location_normalize_settings($settings);
$form['vanevents_createevent']['locations'] = location_form($settings, array());
Anyone know how to set the default value for the actual location field? I'm sure it's easy but I can't figure it out/find it in the docs for the Location module's API.
TIA,
Benjy