View source
<?php
function gm3_views_api() {
return array(
'api' => 3,
);
}
function gm3_library() {
return array(
'gm3' => array(
'title' => t('Google Maps Javascript API V3'),
'website' => 'http://code.google.com/apis/maps/documentation/javascript/',
'version' => '3',
'js' => array(
array(
'data' => 'http://maps.googleapis.com/maps/api/js?sensor=false',
'options' => 'external',
'preprocess' => FALSE,
),
array(
'data' => drupal_get_path('module', 'gm3') . "/js/gm3.getClass.js",
),
array(
'data' => drupal_get_path('module', 'gm3') . "/js/gm3.js",
),
array(
'data' => array(
'gm3' => array(
'settings' => array(
'images' => array(
'sprite' => file_create_url(drupal_get_path('module', 'gm3') . '/images/sprite.png'),
),
),
),
),
'type' => 'setting',
),
),
'css' => array(
array(
'data' => 'http://code.google.com/apis/maps/documentation/javascript/examples/default.css',
),
),
),
'gm3.infobubble' => array(
'title' => t('Google Info Bubble'),
'website' => '',
'version' => 1,
'js' => array(
array(
'data' => drupal_get_path('module', 'gm3') . "/js/gm3.infobubble.js",
),
),
),
'gm3.clusterer' => array(
'title' => t('Google Marker Cluster'),
'website' => 'http://google-maps-utility-library-v3.googlecode.com/',
'version' => '2.0.7',
'js' => array(
array(
'data' => 'http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.7/src/markerclusterer_packed.js',
'options' => 'external',
'preprocess' => FALSE,
),
),
),
'gm3.convexhull' => array(
'title' => t('Google Convex Hull'),
'website' => 'http://www.geocodezip.com/map-markers_ConvexHull_Polygon.asp',
'version' => '1',
'js' => array(
array(
'data' => drupal_get_path('module', 'gm3') . "/js/gm3.convexhull.js",
),
),
),
'gm3.geocoder' => array(
'title' => t('Google Maps Javascript API V3: Geocoder library'),
'website' => 'http://code.google.com/apis/maps/documentation/javascript/geometry.html',
'version' => '3',
'js' => array(
array(
'data' => 'http://maps.googleapis.com/maps/api/js?libraries=geometry&sensor=false',
'options' => 'external',
'preprocess' => FALSE,
),
),
'dependencies' => array(
array(
'gm3',
'gm3',
),
),
),
'gm3.point' => array(
'title' => t('Google Maps Javascript API V3: Point drawing'),
'website' => 'http://code.google.com/apis/maps/',
'version' => '3',
'js' => array(
array(
'data' => drupal_get_path('module', 'gm3') . "/js/gm3.point.js",
),
),
'dependencies' => array(
array(
'gm3',
'gm3',
),
array(
'gm3',
'gm3.clusterer',
),
array(
'gm3',
'gm3.infobubble',
),
),
),
'gm3.polygon' => array(
'title' => t('Google Maps Javascript API V3: Polygon drawing'),
'website' => 'http://code.google.com/apis/maps/documentation/javascript/geometry.html',
'version' => '3',
'js' => array(
array(
'data' => drupal_get_path('module', 'gm3') . "/js/gm3.polygon.lib.js",
),
array(
'data' => drupal_get_path('module', 'gm3') . "/js/gm3.polygon.js",
),
),
'dependencies' => array(
array(
'gm3',
'gm3',
),
array(
'gm3',
'gm3.infobubble',
),
),
),
'gm3.rectangle' => array(
'title' => t('Google Maps Javascript API V3: Rectangle drawing'),
'website' => 'http://code.google.com/apis/maps/documentation/javascript/geometry.html',
'version' => '3',
'js' => array(
array(
'data' => drupal_get_path('module', 'gm3') . "/js/gm3.rectangle.js",
),
),
'dependencies' => array(
array(
'gm3',
'gm3.polygon',
),
),
),
'gm3.polyline' => array(
'title' => t('Google Maps Javascript API V3: Polygon drawing'),
'website' => 'http://code.google.com/apis/maps/documentation/javascript/geometry.html',
'version' => '3',
'js' => array(
array(
'data' => drupal_get_path('module', 'gm3') . "/js/gm3.polyline.lib.js",
),
array(
'data' => drupal_get_path('module', 'gm3') . "/js/gm3.polyline.js",
),
),
'dependencies' => array(
array(
'gm3',
'gm3',
),
array(
'gm3',
'gm3.infobubble',
),
),
),
'gm3.geometry' => array(
'title' => t('Google Maps Javascript API V3: Geometry library'),
'website' => 'http://code.google.com/apis/maps/documentation/javascript/geometry.html',
'version' => '3',
'js' => array(
array(
'data' => 'http://maps.googleapis.com/maps/api/js?libraries=geometry&sensor=false',
'options' => 'external',
'preprocess' => FALSE,
),
),
'dependencies' => array(
array(
'gm3',
'gm3',
),
),
),
);
}
function gm3_theme() {
return array(
'gm3_map' => array(
'variables' => array(
'map' => array(
'id' => 'gm3-map',
),
),
'file' => 'gm3.theme.inc',
),
'gm3_view_gm3' => array(
'variables' => array(),
'file' => 'gm3.theme.inc',
),
'gm3_point_button' => array(
'variables' => array(
'id' => 'gm3-map',
),
'file' => 'gm3.theme.inc',
),
'gm3_polygon_button' => array(
'variables' => array(
'id' => 'gm3-map',
),
'file' => 'gm3.theme.inc',
),
'gm3_rectangle_button' => array(
'variables' => array(
'id' => 'gm3-map',
),
'file' => 'gm3.theme.inc',
),
'gm3_polyline_button' => array(
'variables' => array(
'id' => 'gm3-map',
),
'file' => 'gm3.theme.inc',
),
'gm3_beautytip' => array(
'variables' => array(
'selector' => '',
'text' => '',
),
'file' => 'gm3.theme.inc',
),
);
}
function gm3_load_geophp() {
static $filename = FALSE;
if (!$filename) {
if (function_exists('libraries_get_path')) {
$library_folder = libraries_get_path('geoPHP');
if (!$library_folder) {
$library_folder = libraries_get_path('geophp');
}
$file = $library_folder . '/geoPHP.inc';
}
else {
$file = drupal_get_path('module', 'gm3') . '/geoPHP/geoPHP.inc';
}
if (file_exists($file)) {
if (include_once $file) {
$filename = $file;
}
}
}
return $filename;
}
function gm3_menu() {
return array(
'admin/config/content/gm3' => array(
'title' => 'Google Map settings',
'description' => 'Configure default behavior of the Google Map module.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'gm3_admin_settings_form',
),
'access arguments' => array(
'administer gm3',
),
'file' => 'gm3.admin.inc',
),
);
}
function gm3_settings() {
return variable_get('gm3_default_settings', array(
'width' => '100%',
'height' => '500px',
'center' => array(
'latitude' => 52,
'longitude' => 0,
),
'disableDefaultUI' => FALSE,
'disableDoubleClickZoom' => FALSE,
'draggable' => TRUE,
'draggableCursor' => 'move',
'draggingCursor' => 'move',
'heading' => 0,
'keyboardShortcuts' => TRUE,
'mapTypeControl' => TRUE,
'mapTypeControlOptions' => array(
'mapTypeIds' => array(
'google.maps.MapTypeId.HYBRID',
'google.maps.MapTypeId.ROADMAP',
'google.maps.MapTypeId.SATELLITE',
'google.maps.MapTypeId.TERRAIN',
),
'style' => 'google.maps.MapTypeControlStyle.DEFAULT',
'position' => 'google.maps.ControlPosition.TOP_RIGHT',
),
'mapTypeId' => 'google.maps.MapTypeId.TERRAIN',
'maxZoom' => null,
'minZoom' => 2,
'noClear' => FALSE,
'overviewMapControl' => FALSE,
'overviewMapControlOptions' => array(
'opened' => TRUE,
),
'panControl' => FALSE,
'panControlOptions' => array(
'position' => 'google.maps.ControlPosition.TOP_LEFT',
),
'rotateControl' => TRUE,
'rotateControlOptions' => array(
'position' => 'google.maps.ControlPosition.TOP_LEFT',
),
'scaleControl' => FALSE,
'scaleControlOptions' => array(
'position' => 'google.maps.ControlPosition.BOTTOM_LEFT',
'style' => 'google.maps.ScaleControlStyle.DEFAULT',
),
'scrollwheel' => TRUE,
'streetViewControl' => FALSE,
'streetViewControlOptions' => array(
'position' => '',
),
'tilt' => 0,
'zoom' => 4,
'zoomControl' => TRUE,
'zoomControlOptions' => array(
'position' => 'google.maps.ControlPosition.TOP_LEFT',
'style' => 'google.maps.ZoomControlStyle.DEFAULT',
),
));
}