You are here

gm3_region.module in Google Maps API V3 7

File

gm3_region/gm3_region.module
View source
<?php

/**
 * Data files are generated by:
 * 
 * $ ogrinfo level4.shp level4 > level_4_data
 */

/**
 * Implementation of hook_menu().
 */
function gm3_region_menu() {
  return array(
    'gm3_region/callback/%' => array(
      'title' => 'GM3 Region callback',
      'page callback' => 'gm3_region_get_points',
      'page arguments' => array(
        2,
      ),
      'file' => 'gm3_region.callback.inc',
      'access arguments' => array(
        'access content',
      ),
      'type' => MENU_CALLBACK,
    ),
    'gm3_region/callback2/%/%/%' => array(
      'title' => 'GM3 Region callback',
      'page callback' => 'gm3_region_get_region_id_from_latlng',
      'page arguments' => array(
        2,
        3,
        4,
      ),
      'file' => 'gm3_region.callback.inc',
      'access arguments' => array(
        'access content',
      ),
      'type' => MENU_CALLBACK,
    ),
  );
}

/**
 * Implementation of hook_library().
 * 
 * FIXME - Select countries.  Click on a region could bring up an option to 
 * select the subregions (TDWG 4).
 */
function gm3_region_library() {
  return array(
    // Enable the clicking of countries.
    'region' => array(
      'title' => t('Google Maps Javascript API V3: Region selection'),
      'website' => 'http://code.google.com/apis/maps/',
      'version' => '3',
      'js' => array(
        array(
          'data' => drupal_get_path('module', 'gm3_region') . "/js/gm3_region.region.js",
        ),
        array(
          'data' => array(
            'gm3_region' => array(
              'callback' => url('gm3_region/callback'),
              'callback2' => url('gm3_region/callback2'),
            ),
          ),
          'type' => 'setting',
        ),
      ),
      'dependencies' => array(
        array(
          'gm3',
          'gm3.polygon',
        ),
      ),
    ),
  );
}

/**
 * Implementation of hook_theme().
 */
function gm3_region_theme() {
  return array(
    'gm3_region_button' => array(
      'variables' => array(
        'id' => 'gm3-map',
      ),
      'file' => 'gm3_region.theme.inc',
    ),
    'gm3_region_region_text' => array(
      'variables' => array(
        'data' => array(),
      ),
      'file' => 'gm3_region.theme.inc',
    ),
  );
}

Functions

Namesort descending Description
gm3_region_library Implementation of hook_library().
gm3_region_menu Implementation of hook_menu().
gm3_region_theme Implementation of hook_theme().