JGoogleEmbedMaps
Extends \JGoogleEmbedGoogle Maps embed class for the Joomla Platform.
since |
3.1.4 |
---|---|
deprecated |
4.0 Use the |
package |
Joomla.Platform |
Methods
__construct
Constructor.
__construct(\Joomla\Registry\Registry $options = null, \JUri $uri = null)
since |
3.1.4 |
---|
Arguments
- $options
\Joomla\Registry\Registry
Google options object- $uri
\JUri
URL 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
string
The event name- $function
string
The event handling function body
Response
\JGoogleEmbedMaps
The 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
mixed
A latitude/longitude array or an address string- $title
mixed
The hover-text for the marker- $options
array
Options for marker- $events
array
Events for marker
Response
mixed
The 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
string
The event name
Response
string
The event handler content
deleteMarker
Delete a marker from the map
deleteMarker(integer $index = null) : array
since |
3.1.4 |
---|
Arguments
- $index
integer
Index of marker to delete (defaults to last added marker)
Response
array
The latitude/longitude of the deleted marker
echoBody
Method to output the body for the API
echoBody() : null
since |
3.1.4 |
---|
Response
null
echoHeader
Method to output the javascript header for the embed API
echoHeader() : null
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
string
The address to geocode
Response
array
An array containing Google's geocode data
getAdditionalJavascript
Method to get additional map options
getAdditionalJavascript() : string
since |
3.1.4 |
---|
Response
string
The options
getAdditionalMapOptions
Method to get additional map options
getAdditionalMapOptions() : string
since |
3.1.4 |
---|
Response
string
The options
getAsyncCallback
Method to get callback function for async javascript loading
getAsyncCallback() : string
since |
3.1.4 |
---|
Response
string
The ID
getAutoload
Checks how the script should be loaded
getAutoload() : string
since |
3.1.4 |
---|
Response
string
Autoload type (onload, jquery, mootools, or false)
getBody
Method to retrieve the body for the API
getBody() : string
since |
3.1.4 |
---|
Response
string
The body
getCenter
Method to set the center of the map
getCenter() : mixed
since |
3.1.4 |
---|
Response
mixed
A latitude longitude array or an address string
getHeader
Method to retrieve the header for the API
getHeader() : string
since |
3.1.4 |
---|
Response
string
The header
getKey
Method to get the API key
getKey() : string
since |
3.1.4 |
---|
Response
string
The Google Maps API key
getMapClass
Method to get the class of the map div
getMapClass() : string
since |
3.1.4 |
---|
Response
string
The class
getMapId
Method to get the id of the map div
getMapId() : string
since |
3.1.4 |
---|
Response
string
The ID
getMapStyle
Method to get the style of the map div
getMapStyle() : string
since |
3.1.4 |
---|
Response
string
The style
getMapType
Method to get the map type setting
getMapType() : string
since |
3.1.4 |
---|
Response
string
The class
getOption
Get an option from the JGoogleEmbed instance.
getOption(string $key) : mixed
since |
3.1.4 |
---|
Arguments
- $key
string
The name of the option to get.
Response
mixed
The option value.
getZoom
Method to get the zoom
getZoom() : integer
since |
3.1.4 |
---|
Response
integer
The zoom level
hasSensor
Checks if a sensor is set to be required
hasSensor() : boolean
since |
3.1.4 |
---|
Response
boolean
True if asynchronous
isAsync
Checks if the javascript is set to be asynchronous
isAsync() : boolean
since |
3.1.4 |
---|
Response
boolean
True if asynchronous
isSecure
Method to retrieve the javascript header for the embed API
isSecure() : string
since |
3.1.4 |
---|
Response
string
The header
listEventHandlers
List the events added to the map
listEventHandlers() : array
since |
3.1.4 |
---|
Response
array
A list of events
listMarkers
List the markers added to the map
listMarkers() : array
since |
3.1.4 |
---|
Response
array
A list of markers
noSensor
Don't require access to sensor data
noSensor() : \JGoogleEmbedAMaps
since |
3.1.4 |
---|
Response
\JGoogleEmbedAMaps
The object for method chaining
setAdditionalJavascript
Method to add additional javascript
setAdditionalJavascript(array $script) : \JGoogleEmbedMaps
since |
3.1.4 |
---|
Arguments
- $script
array
Additional javascript
Response
\JGoogleEmbedMaps
The object for method chaining
setAdditionalMapOptions
Method to add additional map options
setAdditionalMapOptions(array $options) : \JGoogleEmbedMaps
since |
3.1.4 |
---|
Arguments
- $options
array
Additional map options
Response
\JGoogleEmbedMaps
The 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
string
The callback function name
Response
\JGoogleEmbedMaps
The object for method chaining
setAutoload
Automatically add the callback to the window
setAutoload(string $type = 'onload') : \JGoogleEmbedAMaps
since |
3.1.4 |
---|
Arguments
- $type
string
The method to add the callback (options are onload, jquery, mootools, and false)
Response
\JGoogleEmbedAMaps
The 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
mixed
A latitude/longitude array or an address string- $title
mixed
Title of marker or false for no marker- $markeroptions
array
Options for marker- $markerevents
array
Events for marker
Response
\JGoogleEmbedMaps
The 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
string
The Google Maps API key
Response
\JGoogleEmbedMaps
The object for method chaining
setMapClass
Method to set the map div class
setMapClass(string $class) : \JGoogleEmbedMaps
since |
3.1.4 |
---|
Arguments
- $class
string
The class
Response
\JGoogleEmbedMaps
The object for method chaining
setMapId
Method to set the map div id
setMapId(string $id) : \JGoogleEmbedMaps
setMapStyle
Method to set the map div style
setMapStyle(string $style) : \JGoogleEmbedMaps
since |
3.1.4 |
---|
Arguments
- $style
string
The style
Response
\JGoogleEmbedMaps
The object for method chaining
setMapType
Method to set the map type ()
setMapType(string $type) : \JGoogleEmbedMaps
since |
3.1.4 |
---|
Arguments
- $type
string
Valid types are ROADMAP, SATELLITE, HYBRID, and TERRAIN
Response
\JGoogleEmbedMaps
The object for method chaining
setOption
Set an option for the JGoogleEmbed instance.
setOption(string $key, mixed $value) : \JGoogleEmbed
since |
3.1.4 |
---|
Arguments
- $key
string
The name of the option to set.- $value
mixed
The option value to set.
Response
\JGoogleEmbed
This object for method chaining.
setZoom
Method to set the map zoom
setZoom(integer $zoom) : \JGoogleEmbedMaps
since |
3.1.4 |
---|
Arguments
- $zoom
integer
Zoom level (0 is whole world)
Response
\JGoogleEmbedMaps
The object for method chaining
useAsync
Load javascript asynchronously
useAsync() : \JGoogleEmbedMaps
useSensor
Require access to sensor data
useSensor() : \JGoogleEmbedMaps
useSync
Load javascript synchronously
useSync() : \JGoogleEmbedAMaps
since |
3.1.4 |
---|
Response
\JGoogleEmbedAMaps
The object for method chaining
Properties
http
The HTTP client object to use in sending HTTP requests.
since |
3.1.4 |
---|
Type(s)
\JHttp
uri
URI of the page being rendered.
since |
3.1.4 |
---|
Type(s)
\JUri