Jump to Content

Objective HTML

Google Maps for ExpressionEngine

The complete geolocation and mapping toolkit

ExpressionEngine Hooks

Each hook has its own unique set of parameters and returned value. Your application can extend any of the following hooks:

gmap_center Returns: String

This hook allows you to modify the JavaScript before it is returned. This hook only called when the exp:gmap:center method is executed.

Parameters
$response
Returned array from the geocoder
$map_id
The id of the map to be centered
$latitude
The latitude of the center location
$longitude
The longitude of the center location
Back to Top

gmap_directions_response Returns: Array

This hook allows you to modify the directions response before it is used. This hook is called when the exp:gmap:directions tag is executed.

Parameters
$response
Returned array from the directions API
Back to Top

gmap_directions_route Returns: Array

This hook allows you to modify the individual routes of the response. This hook is called when the exp:gmap:directions tag is executed.

Parameters
$route
An array from the route array from the directions response
Back to Top

gmap_directions_leg Returns: Array

This hook allows you to modify the individual legs of the route. This hook is called when the exp:gmap:directions tag is executed.

Parameters
$leg
A leg from the route array from the directions response
Back to Top

gmap_directions_step Returns: Array

This hook allows you to modify the individual steps of the response. This hook is called when the exp:gmap:directions tag is executed.

Parameters
$step
A step from the directions response
Back to Top

gmap_directions_instructions_html Returns: String

This hook allows you to modify the individual instructions html. This hook is called when the exp:gmap:directions tag is executed.

Parameters
$html
A step from the directions response in HTML format
Back to Top

gmap_directions_vars Returns: Array

This hook allows you to modify the variables of the response for each for. This hook is called when the exp:gmap:directions tag is executed.

Parameters
$vars
An array of variables to be parsed
Back to Top

gmap_directions_parse Returns: Array

This hook allows you to modify the entire response before it's parsed. This hook is called when the exp:gmap:directions tag is executed.

Parameters
$vars
An array of variables to be parsed
Back to Top

gmap_dropdown Returns: String

This hook allows you to modify the dropdown script before it's returned. This hook is called when the exp:gmap:dropdown tag is executed.

Parameters
$dropdown
The JavaScript and HTML used to create the dropdown
Back to Top

gmap_fetch_param Returns: Array

This hook allows you to modify the parameters as they are fetched.

Parameters
$param
The parameter value to be returned
$name
The name of the parameter that being fetched
$default
The default value expected
$boolean
Value is TRUE if the parameter is a boolean value
$required
Value is TRUE if the parameter is required
Back to Top

gmap_geocode_query Returns: String

This hook allows you to modify the query before it is passed to the geocoder. This hook is called when the exp:gmap:geocode tag is executed.

Parameters
$query
A query string
Back to Top

gmap_geocode_response Returns: Array

This hook allows you to modify the geocoder response after it has returned. This hook is called when the exp:gmap:geocode tag is executed.

Parameters
$response
An array returned by the geocoder
Back to Top

gmap_geocode_parse Returns: Array

This hook allows you to modify variables that will be parsed. This hook is called when the exp:gmap:geocode tag is executed.

Parameters
$vars
An array of variables to be parsed
Back to Top

gmap_init_center Returns: String

This hook allows you to modify the JavaScript that centers the map before it is returned. This hook only called when the exp:gmap:init method is executed.

Parameters
$response
Returned array from the geocoder
$map_id
The id of the map to be centered
$latitude
The latitude of the center location
$longitude
The longitude of the center location
Back to Top

gmap_init_params Returns: Array

This hook allows you modify the params used to initiate the map. This hook only called when the exp:gmap:init method is executed.

Parameters
$options
An array that contains the parameters used to initialize a Google Map.
Back to Top

gmap_init_javascript Returns: String

This hook allows you modify the JavaScript used to initialize the map. This hook only called when the exp:gmap:init method is executed.

Parameters
$return
A string of JavaScript used to initialize the map.
Back to Top

gmap_marker_params Returns: Array

This hook allows you modify the params used to add the marker. This hook only called when the exp:gmap:marker method is executed.

Parameters
$options
An array that contains the parameters used to add the marker.
Back to Top

gmap_marker_center Returns: String

This hook allows you to modify the JavaScript that centers the map before it is returned. This hook only called when the exp:gmap:marker method is executed.

Parameters
$response
Returned array from the geocoder
$map_id
The id of the map to be centered
$latitude
The latitude of the center location
$longitude
The longitude of the center location
Back to Top

gmap_marker_zoom Returns: String

This hook allows you to modify the JavaScript that zoom the map when a marker is added. This hook only called when the exp:gmap:marker method is executed.

Parameters
$zoom_js
A string of JavaScript used to zoom the map
Back to Top

gmap_marker_javascript Returns: String

This hook allows you modify the JavaScript used to add markers to the map. This hook only called when the exp:gmap:marker method is executed.

Parameters
$marker_js
A string of JavaScript used to initialize the map.
Back to Top

gmap_post Returns: Array

This hook allows you modify the POST variables. This hook only called when the exp:gmap:post method is executed.

Parameters
$_POST
An array of POST variables.
Back to Top

gmap_post Returns: Array

This hook allows you modify the post variables that are about to be parsed. This hook only called when the exp:gmap:post method is executed.

Parameters
$vars
An array of variables to be parsed.
Back to Top

gmap_response_markers Returns: Array

This hook allows you to modify the marker array before it's parsed. This hook only called when the exp:gmap:response method is executed.

Parameters
$markers
An array containing marker data.
Back to Top

gmap_response_waypoints Returns: Array

This hook allows you to modify the waypoint array before it's parsed. This hook only called when the exp:gmap:response method is executed.

Parameters
$waypoints
An array containing waypoint data.
Back to Top

gmap_response_region Returns: Array

This hook allows you to modify the region array before it's parsed. This hook only called when the exp:gmap:response method is executed.

Parameters
$region
An array containing region data.
Back to Top

gmap_response Returns: Array

This hook allows you to modify the response array before it's parsed. This hook only called when the exp:gmap:response method is executed.

Parameters
$vars
An array containing the entire response
Back to Top

gmap_route_response Returns: Array

This hook allows you to modify the response before it's manipulated. This hook only called when the exp:gmap:route method is executed.

Parameters
$response
An array containing the entire response
Back to Top

gmap_route_params Returns: Array

This hook allows you to modify the parameters before the route is initialized. This hook only called when the exp:gmap:route method is executed.

Parameters
$params
An array of parameters used to initialize a route
Back to Top

gmap_route Returns: String

This hook allows you to modify the route's JavaScript before it's returned. This hook only called when the exp:gmap:route method is executed.

Parameters
$route_js
A string of JavaScript used to initialize a map
Back to Top

gmap_route_params Returns: Array

This hook allows you to modify the parameters before the route is initialized. This hook only called when the exp:gmap:route method is executed.

Parameters
$params
An array of parameters used to initialize a route
Back to Top

gmap_search_post Returns: Array

This hook allows you to modify the POST variables before the search is initialized. This hook only called when the exp:gmap:search method is executed.

Parameters
$_POST
An array of POST variables
Back to Top

gmap_search_vars Returns: Array

This hook allows you to modify the variables before they are parsed. This hook only called when the exp:gmap:search method is executed.

Parameters
$_POST
An array of POST variables
Back to Top

gmap_streetview Returns: String

This hook allows you to modify the return street view JavaScript.

Parameters
$return
An string containing the HTML for the search form
Back to Top

gmap_search_vars_parse Returns: Array

This hook allows you to modify the variables after they are parsed. This hook only called when the exp:gmap:search method is executed.

Parameters
$vars
An array of parsed variables
$tagdata
Contains the plugin tagdata
Back to Top

This hook allows you to modify the return string it's parsed. This hook only called when the exp:gmap:search method is executed.

Parameters
$return
An string containing the HTML for the search form
Back to Top

gmap_result_post Returns: Array

This hook allows you to modify the POST variables before the results method is executed. This hook only called when the exp:gmap:results method is executed.

Parameters
$_POST
An string containing the HTML for the search form
Back to Top

gmap_result_sql Returns: String

This hook allows you to modify the SQL statement before the query executed. This hook only called when the exp:gmap:results method is executed.

Parameters
$sql
An string containing the HTML for the search form
$vars
Variables later used for parsing
Back to Top

gmap_result_vars Returns: Array

This hook allows you to modify the result variables before they are parsed. This hook only called when the exp:gmap:results method is executed.

Parameters
$vars
Variables that be will parsed
Back to Top

gmap_zoom Returns: String

This hook allows you to modify the JavaScript used to zoom the map. This hook only called when the exp:gmap:zoom method is executed.

Parameters
$zoom_js
An string containing the JavaScript used to zoom the map
Back to Top