JGoogleEmbedMaps

Extends \JGoogleEmbed

Google Maps embed class for the Joomla Platform.

deprecated
since

3.1.4

deprecated

4.0 Use the joomla/google package via Composer instead

package

Joomla.Platform

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry $options = null, \JUri $uri = null) 
inherited
since

3.1.4

Arguments

$options

\Joomla\Registry\RegistryGoogle options object

$uri

\JUriURL of the page being rendered

addEventHandler

Method to add an event handler to the map.

addEventHandler(string $type, string $function) : \JGoogleEmbedMaps

Event handlers must be passed in either as callback name or fully qualified function declaration

example

add an event call: $map->addEventHandler('click', 'function(){ alert("map click event"); }');

since

3.1.4

Arguments

$type

stringThe event name

$function

stringThe event handling function body

Response

\JGoogleEmbedMapsThe object for method chaining

addMarker

Add a marker to the map

addMarker(mixed $location, mixed $title = null, array $options = array(), array $events = array()) : mixed
example

events call: $map->addMarker( array(0, 0), 'My Marker', array(), array( 'click' => 'function() { // code goes here } ) )

since

3.1.4

Arguments

$location

mixedA latitude/longitude array or an address string

$title

mixedThe hover-text for the marker

$options

arrayOptions for marker

$events

arrayEvents for marker

Response

mixedThe marker or false on failure

deleteEventHandler

Method to remove an event handler from the map

deleteEventHandler(string $type = null) : string
example

delete an event call: $map->deleteEventHandler('click');

since

3.1.4

Arguments

$type

stringThe event name

Response

stringThe event handler content

deleteMarker

Delete a marker from the map

deleteMarker(integer $index = null) : array
since

3.1.4

Arguments

$index

integerIndex of marker to delete (defaults to last added marker)

Response

arrayThe latitude/longitude of the deleted marker

echoBody

Method to output the body for the API

echoBody() : null
inherited
since

3.1.4

Response

null

echoHeader

Method to output the javascript header for the embed API

echoHeader() : null
inherited
since

3.1.4

Response

null

geocodeAddress

Method to get the location information back from an address

geocodeAddress(string $address) : array
since

3.1.4

Arguments

$address

stringThe address to geocode

Response

arrayAn array containing Google's geocode data

getAdditionalJavascript

Method to get additional map options

getAdditionalJavascript() : string
since

3.1.4

Response

stringThe options

getAdditionalMapOptions

Method to get additional map options

getAdditionalMapOptions() : string
since

3.1.4

Response

stringThe options

getAsyncCallback

Method to get callback function for async javascript loading

getAsyncCallback() : string
since

3.1.4

Response

stringThe ID

getAutoload

Checks how the script should be loaded

getAutoload() : string
since

3.1.4

Response

stringAutoload type (onload, jquery, mootools, or false)

getBody

Method to retrieve the body for the API

getBody() : string
inherited abstract
since

3.1.4

Response

stringThe body

getCenter

Method to set the center of the map

getCenter() : mixed
since

3.1.4

Response

mixedA latitude longitude array or an address string

getHeader

Method to retrieve the header for the API

getHeader() : string
inherited abstract
since

3.1.4

Response

stringThe header

getKey

Method to get the API key

getKey() : string
since

3.1.4

Response

stringThe Google Maps API key

getMapClass

Method to get the class of the map div

getMapClass() : string
since

3.1.4

Response

stringThe class

getMapId

Method to get the id of the map div

getMapId() : string
since

3.1.4

Response

stringThe ID

getMapStyle

Method to get the style of the map div

getMapStyle() : string
since

3.1.4

Response

stringThe style

getMapType

Method to get the map type setting

getMapType() : string
since

3.1.4

Response

stringThe class

getOption

Get an option from the JGoogleEmbed instance.

getOption(string $key) : mixed
inherited
since

3.1.4

Arguments

$key

stringThe name of the option to get.

Response

mixedThe option value.

getZoom

Method to get the zoom

getZoom() : integer
since

3.1.4

Response

integerThe zoom level

hasSensor

Checks if a sensor is set to be required

hasSensor() : boolean
since

3.1.4

Response

booleanTrue if asynchronous

isAsync

Checks if the javascript is set to be asynchronous

isAsync() : boolean
since

3.1.4

Response

booleanTrue if asynchronous

isSecure

Method to retrieve the javascript header for the embed API

isSecure() : string
inherited
since

3.1.4

Response

stringThe header

listEventHandlers

List the events added to the map

listEventHandlers() : array
since

3.1.4

Response

arrayA list of events

listMarkers

List the markers added to the map

listMarkers() : array
since

3.1.4

Response

arrayA list of markers

noSensor

Don't require access to sensor data

noSensor() : \JGoogleEmbedAMaps
since

3.1.4

Response

\JGoogleEmbedAMapsThe object for method chaining

setAdditionalJavascript

Method to add additional javascript

setAdditionalJavascript(array $script) : \JGoogleEmbedMaps
since

3.1.4

Arguments

$script

arrayAdditional javascript

Response

\JGoogleEmbedMapsThe object for method chaining

setAdditionalMapOptions

Method to add additional map options

setAdditionalMapOptions(array $options) : \JGoogleEmbedMaps
since

3.1.4

Arguments

$options

arrayAdditional map options

Response

\JGoogleEmbedMapsThe object for method chaining

setAsyncCallback

Method to set the callback function for async javascript loading

setAsyncCallback(string $callback) : \JGoogleEmbedMaps
since

3.1.4

Arguments

$callback

stringThe callback function name

Response

\JGoogleEmbedMapsThe object for method chaining

setAutoload

Automatically add the callback to the window

setAutoload(string $type = 'onload') : \JGoogleEmbedAMaps
since

3.1.4

Arguments

$type

stringThe method to add the callback (options are onload, jquery, mootools, and false)

Response

\JGoogleEmbedAMapsThe object for method chaining

setCenter

Method to set the center of the map

setCenter(mixed $location, mixed $title = true, array $markeroptions = array(), array $markerevents = array()) : \JGoogleEmbedMaps
example

events call: $map->setCenter( array(0, 0), 'Map Center', array(), array( 'click' => 'function() { // code goes here } ) )

since

3.1.4

Arguments

$location

mixedA latitude/longitude array or an address string

$title

mixedTitle of marker or false for no marker

$markeroptions

arrayOptions for marker

$markerevents

arrayEvents for marker

Response

\JGoogleEmbedMapsThe latitude/longitude of the center or false on failure

setKey

Method to set the API key

setKey(string $key) : \JGoogleEmbedMaps
since

3.1.4

Arguments

$key

stringThe Google Maps API key

Response

\JGoogleEmbedMapsThe object for method chaining

setMapClass

Method to set the map div class

setMapClass(string $class) : \JGoogleEmbedMaps
since

3.1.4

Arguments

$class

stringThe class

Response

\JGoogleEmbedMapsThe object for method chaining

setMapId

Method to set the map div id

setMapId(string $id) : \JGoogleEmbedMaps
since

3.1.4

Arguments

$id

stringThe ID

Response

\JGoogleEmbedMapsThe object for method chaining

setMapStyle

Method to set the map div style

setMapStyle(string $style) : \JGoogleEmbedMaps
since

3.1.4

Arguments

$style

stringThe style

Response

\JGoogleEmbedMapsThe object for method chaining

setMapType

Method to set the map type ()

setMapType(string $type) : \JGoogleEmbedMaps
since

3.1.4

Arguments

$type

stringValid types are ROADMAP, SATELLITE, HYBRID, and TERRAIN

Response

\JGoogleEmbedMapsThe object for method chaining

setOption

Set an option for the JGoogleEmbed instance.

setOption(string $key, mixed $value) : \JGoogleEmbed
inherited
since

3.1.4

Arguments

$key

stringThe name of the option to set.

$value

mixedThe option value to set.

Response

\JGoogleEmbedThis object for method chaining.

setZoom

Method to set the map zoom

setZoom(integer $zoom) : \JGoogleEmbedMaps
since

3.1.4

Arguments

$zoom

integerZoom level (0 is whole world)

Response

\JGoogleEmbedMapsThe object for method chaining

useAsync

Load javascript asynchronously

useAsync() : \JGoogleEmbedMaps
since

3.1.4

Response

\JGoogleEmbedMapsThe object for method chaining

useSensor

Require access to sensor data

useSensor() : \JGoogleEmbedMaps
since

3.1.4

Response

\JGoogleEmbedMapsThe object for method chaining

useSync

Load javascript synchronously

useSync() : \JGoogleEmbedAMaps
since

3.1.4

Response

\JGoogleEmbedAMapsThe object for method chaining

Properties

http

The HTTP client object to use in sending HTTP requests.

since

3.1.4

Type(s)

\JHttp

options

Options for the Google data object.

inherited
since

3.1.4

Type(s)

\Joomla\Registry\Registry

uri

URI of the page being rendered.

inherited
since

3.1.4

Type(s)

\JUri