Exemplo n.º 1
0
function locationsform(cs_form $form, &$form_state)
{
    /*
        google.maps.MapTypeId.HYBRID
        google.maps.MapTypeId.ROADMAP
        google.maps.MapTypeId.SATELLITE
        google.maps.MapTypeId.TERRAIN
    */
    $form->add_field('location', array('title' => 'GeoLocation', 'type' => 'geolocation'))->add_field('map', array('title' => 'MapLocation', 'type' => 'gmaplocation', 'scrollwheel' => TRUE, 'zoom' => 15, 'mapheight' => '400px', 'default_value' => array('latitude' => 45.434332, 'longitude' => 12.33844), 'maptype' => 'google.maps.MapTypeId.TERRAIN', 'with_current_location' => TRUE))->add_field('decode', array('title' => 'GeoDecode', 'type' => 'gmaplocation', 'with_geocode' => TRUE, 'lat_lon_type' => 'textfield', 'zoom' => 15, 'default_value' => array('latitude' => 51.48257659999999, 'longitude' => -0.0076589)))->add_field('decode_nomap', array('title' => 'GeoDecode No Map', 'type' => 'gmaplocation', 'with_geocode' => TRUE, 'with_map' => FALSE, 'lat_lon_type' => 'textfield', 'default_value' => array('latitude' => 51.48257659999999, 'longitude' => -0.0076589)))->add_field('submit', array('type' => 'submit'));
    return $form;
}