GoogleMapAPI GoogleMapAPI(
[string
$map_id = 'map'], [string
$app_id = 'MyMapApp']
)
|
|
class constructor
Parameters:
string |
$map_id: |
the DOM element ID for the map |
string |
$app_id: |
YOUR Yahoo App ID |
void addDirections(
[string
$start_address = ''], [string
$dest_address = ''], [string
$dom_id = ''], [bool
$add_markers = true], [
$elevation_samples = 256], [
$elevation_width = ""], [
$elevation_height = ""], [
$elevation_dom_id = '']
)
|
|
Add directions route to the map and adds text directions container with id=$dom_id
Parameters:
string |
$start_address: |
|
string |
$dest_address: |
|
string |
$dom_id: |
DOM Element ID for directions container. |
bool |
$add_markers: |
Add a marker at start and dest locations. |
|
$elevation_samples: |
|
|
$elevation_width: |
|
|
$elevation_height: |
|
|
$elevation_dom_id: |
|
string addIcon(
string
$iconImage, [
$iconShadowImage = ''], [string
$iconAnchorX = 'x'], [string
$iconAnchorY = 'x'], [string
$infoWindowAnchorX = 'x'], [string
$infoWindowAnchorY = 'x'], string
$iconShadow
)
|
|
add an icon to "iconset"
Parameters:
string |
$iconImage: |
URL to marker icon image |
string |
$iconShadow: |
URL to marker icon shadow image |
string |
$iconAnchorX: |
X coordinate for icon anchor point |
string |
$iconAnchorY: |
Y coordinate for icon anchor point |
string |
$infoWindowAnchorX: |
X coordinate for info window anchor point |
string |
$infoWindowAnchorY: |
Y coordinate for info window anchor point |
|
$iconShadowImage: |
|
API Tags:
Return: | Returns the icon's key. |
void addKMLOverlay(
$file
)
|
|
function to add a KML overlay to the map.
*Note that this expects a filename and file parsing/processing is done on the client side
Parameters:
int|bool addMarkerByAddress(
string
$address, [string
$title = ''], [string
$html = ''], [string
$tooltip = ''], [string
$icon_filename = ''], [string
$icon_shadow_filename = '']
)
|
|
adds a map marker by address - DEPRECATION WARNING: Tabs are no longer supported in V3, if this changes this can be easily updated.
Parameters:
string |
$address: |
the map address to mark (street/city/state/zip) |
string |
$title: |
the title display in the sidebar |
string |
$html: |
the HTML block to display in the info bubble (if empty, title is used) |
string |
$tooltip: |
Tooltip to display (deprecated?) |
string |
$icon_filename: |
Web file location (eg http://somesite/someicon.gif) to use for icon |
string |
$icon_shadow_filename: |
Web file location (eg http://somesite/someicon.gif) to use for icon shadow |
int|bool addMarkerByCoords(
string
$lon, string
$lat, [string
$title = ''], [string
$html = ''], [string
$tooltip = ''], [string
$icon_filename = ''], [string
$icon_shadow_filename = '']
)
|
|
adds a map marker by lat/lng coordinates - DEPRECATION WARNING: Tabs are no longer supported in V3, if this changes this can be easily updated.
Parameters:
string |
$lon: |
the map longitude (horizontal) |
string |
$lat: |
the map latitude (vertical) |
string |
$title: |
the title display in the sidebar |
string |
$html: |
the HTML block to display in the info bubble (if empty, title is used) |
string |
$tooltip: |
Tooltip to display (deprecated?) |
string |
$icon_filename: |
Web file location (eg http://somesite/someicon.gif) to use for icon |
string |
$icon_shadow_filename: |
Web file location (eg http://somesite/someicon.gif) to use for icon shadow |
bool addMarkerOpener(
string
$marker_id, string
$dom_id
)
|
|
adds a DOM object ID to specified marker to open the marker's info window.
Does nothing if the info windows is disabled.
Parameters:
string |
$marker_id: |
ID of the marker to associate to |
string |
$dom_id: |
ID of the DOM object to use to open marker info window |
API Tags:
Return: | true/false status |
void addOverlay(
$bds_lat1,
$bds_lon1,
$bds_lat2,
$bds_lon2,
$img_src, [
$opacity = 100]
)
|
|
function to add an overlay to the map.
Parameters:
|
$bds_lat1: |
|
|
$bds_lon1: |
|
|
$bds_lat2: |
|
|
$bds_lon2: |
|
|
$img_src: |
|
|
$opacity: |
|
bool|int addPolyLineByAddress(
string
$address1, string
$address2, [string
$id = false], [string
$color = ''], [string
$weight = 0], [string
$opacity = 0]
)
|
|
adds a map polyline by address if color, weight and opacity are not defined, use the google maps defaults
Parameters:
string |
$address1: |
the map address to draw from |
string |
$address2: |
the map address to draw to |
string |
$id: |
An array id to use to append coordinates to a line |
string |
$color: |
the color of the line (format: #000000) |
string |
$weight: |
the weight of the line in pixels |
string |
$opacity: |
the line opacity (percentage) |
API Tags:
Return: | Array id of newly added point or false |
bool|int addPolylineByAddressArray(
array
$polyline_array, [string
$id = false], [string
$color = ''], [string
$weight = 0], [string
$opacity = 0]
)
|
|
adds polyline by passed array
if color, weight and opacity are not defined, use the google maps defaults
Parameters:
array |
$polyline_array: |
array of addresses |
string |
$id: |
An array id to use to append coordinates to a line |
string |
$color: |
the color of the line (format: #000000) |
string |
$weight: |
the weight of the line in pixels |
string |
$opacity: |
the line opacity (percentage) |
API Tags:
Return: | Array id of newly added point or false |
string addPolyLineByCoords(
string
$lon1, string
$lat1, string
$lon2, string
$lat2, [string
$id = false], [string
$color = ''], [string
$weight = 0], [string
$opacity = 0]
)
|
|
adds a map polyline by map coordinates if color, weight and opacity are not defined, use the google maps defaults
Parameters:
string |
$lon1: |
the map longitude to draw from |
string |
$lat1: |
the map latitude to draw from |
string |
$lon2: |
the map longitude to draw to |
string |
$lat2: |
the map latitude to draw to |
string |
$id: |
An array id to use to append coordinates to a line |
string |
$color: |
the color of the line (format: #000000) |
string |
$weight: |
the weight of the line in pixels |
string |
$opacity: |
the line opacity (percentage) |
API Tags:
Return: | id of the created/updated polyline array |
bool|int addPolylineByCoordsArray(
array
$polyline_array, [string
$id = false], [string
$color = ''], [string
$weight = 0], [string
$opacity = 0]
)
|
|
adds polyline by passed array
if color, weight and opacity are not defined, use the google maps defaults
Parameters:
array |
$polyline_array: |
array of lat/long coords |
string |
$id: |
An array id to use to append coordinates to a line |
string |
$color: |
the color of the line (format: #000000) |
string |
$weight: |
the weight of the line in pixels |
string |
$opacity: |
the line opacity (percentage) |
API Tags:
Return: | Array id of newly added point or false |
void addPolylineElevation(
$polyline_id,
$elevation_dom_id, [
$samples = 256], [
$width = ""], [
$height = ""], [
$focus_color = "#00ff00"]
)
|
|
function to add an elevation profile for a polyline to the page
Parameters:
|
$polyline_id: |
|
|
$elevation_dom_id: |
|
|
$samples: |
|
|
$width: |
|
|
$height: |
|
|
$focus_color: |
|
void adjustCenterCoords(
string
$lon, string
$lat
)
|
|
adjust map center coordinates by the given lat/lon point
Parameters:
string |
$lon: |
the map latitude (horizontal) |
string |
$lat: |
the map latitude (vertical) |
void attachStreetViewContainer(
$dom_id
)
|
|
attach a dom id object as a streetview container to the map NOTE: Only one container can be attached to a map.
Parameters:
array createMarkerIcon(
string
$iconImage, [string
$iconShadowImage = ''], [string
$iconAnchorX = 'x'], [string
$iconAnchorY = 'x'], [string
$infoWindowAnchorX = 'x'], [string
$infoWindowAnchorY = 'x']
)
|
|
generate an array of params for a new marker icon image iconShadowImage is optional If anchor coords are not supplied, we use the center point of the image by default.
Can be called statically. For private use by addMarkerIcon() and setMarkerIcon() and addIcon()
Parameters:
string |
$iconImage: |
URL to icon image |
string |
$iconShadowImage: |
URL to shadow image |
string |
$iconAnchorX: |
X coordinate for icon anchor point |
string |
$iconAnchorY: |
Y coordinate for icon anchor point |
string |
$infoWindowAnchorX: |
X coordinate for info window anchor point |
string |
$infoWindowAnchorY: |
Y coordinate for info window anchor point |
API Tags:
Return: | Array with information about newly /previously created icon. |
disable Google Adsense admanager on Map (not supported in V3 API)
void disableAvoidHighways(
)
|
|
disables avoid highways in directions
void disableAvoidTolls(
)
|
|
disables avoid tolls in directions
void disableBikingDirections(
)
|
|
disables biking directions
void disableBikingOverlay(
)
|
|
disable biking overlay (default)
void disableClustering(
)
|
|
disable map marker clustering
void disableDirections(
)
|
|
disables map directions inside info window
void disableElevationDirections(
)
|
|
disable elevation to be displayed for directions
void disableElevationMarker(
)
|
|
disable elevation marker
void disableInfoWindow(
)
|
|
disable map marker info windows
void disableLocalSearch(
)
|
|
disables the type controls (map/satellite/hybrid)
void disableLocalSearchAds(
)
|
|
disables the type controls (map/satellite/hybrid)
void disableMapControls(
)
|
|
disables the map controls (zoom/move)
void disableMapDisplay(
)
|
|
function to disable map display (used to display street view only)
void disableOverviewControl(
)
|
|
disables the overview map control
void disableScaleControl(
)
|
|
disables the scale map control
void disableScrollWheel(
)
|
|
disable mouse scrollwheel on Map
void disableStreetViewControls(
)
|
|
disable biking overlay (default)
void disableTrafficOverlay(
)
|
|
disable traffic overlay (default)
void disableTypeControls(
)
|
|
disables the type controls (map/satellite/hybrid)
void disableWalkingDirections(
)
|
|
disables walking directions
void disableZoomEncompass(
)
|
|
disable zoom to encompass makers
enable Google Adsense admanager on Map (not supported in V3 API)
void enableAvoidHighways(
)
|
|
enables avoid highways in directions
enables avoid tolls in directions
void enableBikingDirections(
)
|
|
enables biking directions
void enableBikingOverlay(
)
|
|
enable biking overlay
enable map marker clustering
enables map directions inside info window
void enableElevationDirections(
)
|
|
enable elevation to be displayed for directions
void enableElevationMarker(
)
|
|
enable elevation marker to be displayed
enable map marker info windows
void enableLocalSearch(
)
|
|
enables the type controls (map/satellite/hybrid)
void enableLocalSearchAds(
)
|
|
enables the type controls (map/satellite/hybrid)
void enableMapControls(
)
|
|
enables the map controls (zoom/move)
function to enable map display
void enableOverviewControl(
)
|
|
enables the overview map control
void enableScaleControl(
)
|
|
enables the scale map control
void enableStreetViewControls(
)
|
|
enable biking overlay
void enableTrafficOverlay(
)
|
|
enable traffic overlay
void enableTypeControls(
)
|
|
enables the type controls (map/satellite/hybrid)
void enableWalkingDirections(
)
|
|
enables walking directions
void enableZoomEncompass(
)
|
|
enable zoom to encompass makers
void fetchURL(
string
$url
)
|
|
fetch a URL. Override this method to change the way URLs are fetched.
Parameters:
bool|array geoGetCoords(
string
$address, [
$depth = 0]
)
|
|
get geocode lat/lon points for given address from Yahoo
Parameters:
API Tags:
Return: | false if can't be geocoded, array or geocdoes if successful |
bool|array geoGetCoordsFull(
string
$address, [
$depth = 0]
)
|
|
get full geocode information for given address from Google NOTE: This does not use the getCache function as there is a lot of data in a full geocode response to cache.
Parameters:
API Tags:
Return: | false if can't be geocoded, array or geocdoes if successful |
float geoGetDistance(
float
$lat1, float
$lon1, float
$lat2, float
$lon2, [float
$unit = 'M']
)
|
|
get distance between to geocoords using great circle distance formula
Parameters:
float |
$lat1: |
|
float |
$lat2: |
|
float |
$lon1: |
|
float |
$lon2: |
|
float |
$unit: |
M=miles, K=kilometers, N=nautical miles, I=inches, F=feet |
void getAddDirectionsJS(
)
|
|
function to render proper calls for directions - for now can only be used on a map, not a streetview
void getAddMarkersJS(
[
$map_id = ""], [
$pano = false]
)
|
|
overridable function for generating js to add markers
Parameters:
function to get overlay creation JS.
bool|array getCache(
string
$address
)
|
|
get the geocode lat/lon points from cache for given address
Parameters:
API Tags:
Return: | False if no cache, array of data if has cache |
void getCreateMarkerJS(
)
|
|
overridable function to generate the js for the js function for creating a marker.
void getCreateOverlayJS(
)
|
|
Get create overlay js
void getElevationMarkerJS(
)
|
|
create JS that is inside of JS plot elevation function
array getGeocode(
string
$address
)
|
|
get the geocode lat/lon points from given address look in cache first, otherwise get from Yahoo
Parameters:
API Tags:
Return: | GeoCode information |
return map header javascript (goes between <head></head>)
string getIconKey(
string
$iconImage, [string
$iconShadow = ""]
)
|
|
function to get icon key
Parameters:
string |
$iconImage: |
URL to marker icon image |
string |
$iconShadow: |
URL to marker icon shadow image |
API Tags:
Return: | Returns formatted icon key from icon or icon+shadow image name pairs |
function to render utility functions for use on the page
return js to set onload function
void getOnLoadFunction(
)
|
|
return js to set onload function
void getPlotElevationJS(
)
|
|
print helper function to draw elevation results as a chart
overridable function to generate polyline js - for now can only be used on a map, not a streetview
void getUtilityFunctions(
)
|
|
print map header javascript (goes between <head></head>)
print map (put at location map will appear)
print map javascript (put just before </body>, or in <header> if using onLoad())
prints onLoad() without having to manipulate body tag.
call this after the print map like so... $map->printMap(); $map->printOnLoad();
void printOnLoadFunction(
)
|
|
print onLoad function name
print sidebar (put at location sidebar will appear)
bool putCache(
string
$address, string
$lon, string
$lat
)
|
|
put the geocode lat/lon points into cache for given address
Parameters:
string |
$address: |
|
string |
$lon: |
the map latitude (horizontal) |
string |
$lat: |
the map latitude (vertical) |
API Tags:
Return: | Status of put cache request |
void setBoundsFudge(
float
$val
)
|
|
set the boundary fudge factor
Parameters:
void setBrowserAlert(
string
$message
)
|
|
set browser alert message for incompatible browsers
Parameters:
void setCenterCoords(
string
$lon, string
$lat
)
|
|
set map center coordinates to lat/lon point
Parameters:
string |
$lon: |
the map latitude (horizontal) |
string |
$lat: |
the map latitude (vertical) |
void setClusterLocation(
$file
)
|
|
Set clustering library file location
Parameters:
void setClusterOptions(
[
$zoom = "null"], [
$gridsize = "null"], [
$styles = "null"]
)
|
|
set clustering options
Parameters:
|
$zoom: |
|
|
$gridsize: |
|
|
$styles: |
|
void setControlSize(
string
$size
)
|
|
sets the map control size (large/small)
Parameters:
string |
$size: |
Large/Small |
void setDSN(
string
$dsn
)
|
|
sets the PEAR::DB dsn
Parameters:
string |
$dsn: |
Takes the form of "mysql://user:pass@localhost/db_name" |
string|false setHeight(
string
$height
)
|
|
sets the height of the map
Parameters:
API Tags:
Return: | Height or false if not a valid value |
void setInfoWindowTrigger(
$type, string
$message
)
|
|
set the info window trigger action
Parameters:
string |
$message: |
click/mouseover |
|
$type: |
|
void setJSAlert(
string
$message
)
|
|
set <noscript> message when javascript is disabled
Parameters:
void setLookupService(
string
$service
)
|
|
set the lookup service to use for geocode lookups default is YAHOO, you can also use GOOGLE.
NOTE: GOOGLE can to intl lookups, but is not an official API, so use at your own risk.
Parameters:
API Tags:
void setMapType(
string
$type
)
|
|
set default map type (map/satellite/hybrid)
Parameters:
string |
$type: |
New V3 Map Types, only include ending word (HYBRID,SATELLITE,TERRAIN,ROADMAP) |
string setMarkerIcon(
string
$iconImage, [string
$iconShadowImage = ''], [string
$iconAnchorX = 'x'], [string
$iconAnchorY = 'x'], [string
$infoWindowAnchorX = 'x'], [string
$infoWindowAnchorY = 'x']
)
|
|
set the default marker icon for ALL markers on the map NOTE: This MUST be set prior to adding markers in order for the defaults to be set correctly.
Parameters:
string |
$iconImage: |
URL to icon image |
string |
$iconShadowImage: |
URL to shadow image |
string |
$iconAnchorX: |
X coordinate for icon anchor point |
string |
$iconAnchorY: |
Y coordinate for icon anchor point |
string |
$infoWindowAnchorX: |
X coordinate for info window anchor point |
string |
$infoWindowAnchorY: |
Y coordinate for info window anchor point |
API Tags:
Return: | A marker icon key. |
string setMarkerIconKey(
string
$iconImage, [
$iconShadow = ''], [string
$iconAnchorX = 'x'], [string
$iconAnchorY = 'x'], [string
$infoWindowAnchorX = 'x'], [string
$infoWindowAnchorY = 'x'], string
$iconShadowImage
)
|
|
function to check if icon is in class "marker_iconset", if it is,
returns the key, if not, creates a new array indice and returns the key
Parameters:
string |
$iconImage: |
URL to icon image |
string |
$iconShadowImage: |
URL to shadow image |
string |
$iconAnchorX: |
X coordinate for icon anchor point |
string |
$iconAnchorY: |
Y coordinate for icon anchor point |
string |
$infoWindowAnchorX: |
X coordinate for info window anchor point |
string |
$infoWindowAnchorY: |
Y coordinate for info window anchor point |
|
$iconShadow: |
|
API Tags:
Return: | A marker icon key. |
void setTypeControlsStyle(
$type
)
|
|
sets map control style
Parameters:
string|false setWidth(
string
$width
)
|
|
sets the width of the map
Parameters:
API Tags:
Return: | Width or false if not a valid value |
void setZoomLevel(
string
$level
)
|
|
sets the default map zoom level
Parameters:
string |
$level: |
Initial zoom level value |
void updateMarkerIconKey(
string
$markerKey, string
$iconKey
)
|
|
updates a marker's icon key.
NOTE: To be used in lieu of addMarkerIcon, now use addIcon + updateMarkerIconKey for explicit icon association
Parameters:
string |
$markerKey: |
Marker key to define which marker's icon to update |
string |
$iconKey: |
Icon key to define which icon to use. |