You are here

function gmap_element_info in GMap Module 7

Same name and namespace in other branches
  1. 7.2 gmap.module \gmap_element_info()

Implement hook_element_info().

File

./gmap.module, line 607
GMap -- Routines to use the Google Maps API in Drupal.

Code

function gmap_element_info() {
  $path = drupal_get_path('module', 'gmap');
  return array(
    'gmap' => array(
      '#input' => FALSE,
      // This isn't a *form* input!!
      '#gmap_settings' => array_merge(gmap_defaults(), array(
        'points' => array(),
        'pointsOverlays' => array(),
        'lines' => array(),
      )),
      '#attached' => array(
        'css' => array(
          $path . '/gmap.css',
        ),
        'js' => _gmap_base_js(),
      ),
      '#pre_render' => array(
        '_gmap_pre_render_map',
      ),
      '#theme' => 'gmap',
    ),
    'gmap_macrotext' => array(
      '#input' => TRUE,
      '#gmap_newtype' => 'textarea',
      //      '#theme' => 'gmap_macrotext',
      '#process' => array(
        'process_gmap_control',
      ),
      '#attached' => array(
        'js' => array(
          "{$path}/js/macro.js" => array(
            'weight' => 2,
          ),
          "{$path}/js/macrobuilder.js" => array(
            'weight' => 2,
          ),
        ),
      ),
      '#theme' => 'textarea',
    ),
    'gmap_overlay_edit' => array(
      '#input' => TRUE,
      '#process' => array(
        'process_gmap_overlay_edit',
      ),
      '#attached' => array(
        'js' => array(
          "{$path}/js/gmap_shapes.js" => array(
            'weight' => 2,
          ),
          "{$path}/js/overlay_edit.js" => array(
            'weight' => 2,
          ),
        ),
      ),
    ),
    'gmap_style' => array(
      '#input' => TRUE,
      '#tree' => TRUE,
      '#gmap_style_type' => 'poly',
      '#process' => array(
        'process_gmap_style',
      ),
    ),
    'gmap_address' => array(
      '#input' => TRUE,
      '#process' => array(
        'process_gmap_address',
      ),
      '#attached' => array(
        'js' => array(
          "{$path}/js/address.js" => array(
            'weight' => 2,
          ),
        ),
      ),
      '#autocomplete_path' => '',
      '#theme' => 'textfield',
    ),
    'gmap_latitude' => array(
      '#input' => TRUE,
      '#gmap_newtype' => 'textfield',
      '#process' => array(
        'process_gmap_control',
      ),
    ),
    'gmap_longitude' => array(
      '#input' => TRUE,
      '#gmap_newtype' => 'textfield',
      '#process' => array(
        'process_gmap_control',
      ),
    ),
    'gmap_latlon' => array(
      '#input' => TRUE,
      '#gmap_newtype' => 'textfield',
      '#process' => array(
        'process_gmap_control',
      ),
    ),
    'gmap_markerchooser' => array(
      '#input' => TRUE,
      '#process' => array(
        'process_gmap_markerchooser',
      ),
    ),
    'gmap_dimension' => array(
      '#input' => TRUE,
      '#gmap_newtype' => 'textfield',
      '#process' => array(
        'process_gmap_control',
      ),
      '#element_validate' => array(
        'gmap_dimension_validate',
      ),
    ),
  );
}