Jump to Content

Objective HTML

Google Maps for ExpressionEngine

The complete geolocation and mapping toolkit

Channel Data API

If you are building your own application that needs access to the core libraries themselves, Channel Data can help bridge the gap. Below are the public method made available by Channel Data.

To use Channel Data make sure to include the library in your add-on's libraries directory and load the api.


$this->EE->load->driver('channel_data');
$this->EE->channel_data->api->load->('gmap');

$response = $this->EE->channel_data->gmap->geocode('Main St.');

Available Methods

center

Returns the javascript needed to center the map on a specific coordinate.


				$this->EE->channel_data->gmap->center($map_id, $latitude, $longitude, $script = FALSE);
			
$map_id
The map's id
$latitude
The center location latitude
$longitude
The center location longitude
$script

clean_js

Cleans a string and preps it to be inserted into JavaScript.


				$this->EE->channel_data->gmap->clean_js($string);
			
$string
Any string containing JavaScript or ready to be inserted into JavaScript.

directions

Returns the javascript needed to get directions.


				$this->EE->channel_data->gmap->directions($map_id, $latitude, $longitude, $script = FALSE);
			
$map_id
The map's id
$latitude
The center location latitude
$longitude
The center location longitude
$script

geocode

Returns a geocoded response ready to be added to a map.


				$this->EE->channel_data->gmap->geocode($query, $limit = FALSE, $offset = 0);
			
$query
A string or coordinate that is passed to the geocoder.
$limit
Limit the amount of results returns. Default is FALSE which returns all results.
$offset
Offset the start of the result set.

Page Incomplete

  • This document is still incomplete. Documentation will be implemented as soon as possible.