Class: GoogleMapAPI
Source Location: /zp-extensions/GoogleMap/GoogleMap.php
Class GoogleMapAPI
Property Summary
| bool |
$ads_manager |
enables Google Adsense Adsmanager on page, not currently supported in beta |
| int |
$ads_max |
The Max number of Adsmanager ads to show on a map |
| string |
$app_id |
DEPRECATED: Google now has geocoding service. |
| float |
$bounds_fudge |
factor by which to fudge the boundaries so that when we zoom encompass, the markers aren't too close to the edge |
| string |
$browser_alert |
message that pops up when the browser is incompatible with Google Maps. |
| float |
$center_lat |
map center latitude (horizontal) calculated automatically as markers are added to the map. |
| float |
$center_lon |
map center longitude (vertical) calculated automatically as markers are added to the map. |
| string |
$control_size |
determines the map control type small -> show move/center controls large -> show move/center/zoom controls |
| bool |
$directions |
determines if to/from directions are included inside info window |
| mixed |
$display_map |
determines whether or not to display the map and associated JS on the page |
| string |
$dsn |
PEAR::DB DSN for geocode caching. example: $dsn = 'mysql://user:pass@localhost/dbname'; |
| mixed |
$elevation_directions |
determines whether or not to display an elevation chart for directions that are added to the map. |
| string |
$height |
determines the map height |
| bool |
$info_window |
determines if map markers bring up an info window |
| string |
$js_alert |
message that appears when javascript is disabled. |
| mixed |
$locale |
Class variable for localization |
| bool |
$local_search_ads |
enables local search ads on page NOTE: will only display ads if local_search == true, otherwise just use ad_manager and settings. |
| string |
$map_id |
current map id, set when you instantiate the GoogleMapAPI object. |
| string |
$map_type |
default map type google.maps.MapTypeId.(ROADMAP, SATELLITE, HYBRID, TERRAIN) |
| bool |
$mobile |
Whether to use new V3 mobile functionality |
| bool |
$onload |
use onLoad() to load the map javascript. |
| bool |
$sidebar |
determines if sidebar is enabled |
| string |
$sidebar_id |
sidebar <div> used along with this map. |
| mixed |
$street_view_dom_id |
ID of the container that will hold a street view if streetview controls = true. |
| bool |
$type_controls |
enables map type controls (map/satellite/hybrid/terrain) |
| string |
$type_controls_list |
sets default option control selections (ROADMAP, SATELLITE, HYBRID, TERRAIN) |
| string |
$type_controls_style |
sets default option for type controls(DEFAULT, HORIZONTAL_BAR, DROPDOWN_MENU) |
| float |
$use_suggest |
use the first suggestion by a google lookup if exact match not found |
| string |
$width |
determines the map width |
| string |
$window_trigger |
determines if info window appears with a click or mouseover |
| int |
$zoom |
determines the default zoom level |
| bool |
$zoom_encompass |
determines if we should zoom to minimum level (above this->zoom value) that will encompass all markers |
| mixed |
$_directions |
Class variable that will store information to render directions |
| string |
$_directions_header |
Class variable that will store generated header code for JS to display directions |
| float |
$_max_lon |
maximum longitude of all markers |
| bool |
$_minify_js |
Class variable that will store flag to minify js - this can be overwritten after object is instantiated. Include JSMin.php if you want to use JS Minification. |
| float |
$_min_lon |
minimum longitude of all markers |
Method Summary
| void |
addDirections() |
Add directions route to the map and adds text directions container with id=$dom_id |
| string |
addIcon() |
add an icon to "iconset" |
| int|bool |
addMarkerByAddress() |
adds a map marker by address - DEPRECATION WARNING: Tabs are no longer supported in V3, if this changes this can be easily updated. |
| int|bool |
addMarkerByCoords() |
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. |
| bool |
addMarkerOpener() |
adds a DOM object ID to specified marker to open the marker's info window. |
| void |
addOverlay() |
function to add an overlay to the map. |
| string |
addPolygonByCoords() |
#)MS adds a map polygon by map coordinates if color, weight and opacity are not defined, use the google maps defaults |
| bool|int |
addPolyLineByAddress() |
adds a map polyline by address if color, weight and opacity are not defined, use the google maps defaults |
| string |
addPolyLineByCoords() |
adds a map polyline by map coordinates if color, weight and opacity are not defined, use the google maps defaults |
| void |
attachStreetViewContainer() |
attach a dom id object as a streetview container to the map NOTE: Only one container can be attached to a map. |
| array |
createMarkerIcon() |
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. |
| void |
disableAds() |
disable Google Adsense admanager on Map (not supported in V3 API) |
| void |
disableMapDisplay() |
function to disable map display (used to display street view only) |
| void |
enableAds() |
enable Google Adsense admanager on Map (not supported in V3 API) |
| void |
fetchURL() |
fetch a URL. Override this method to change the way URLs are fetched. |
| bool|array |
geoGetCoords() |
get geocode lat/lon points for given address from Yahoo |
| bool|array |
geoGetCoordsFull() |
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. |
| float |
geoGetDistance() |
get distance between to geocoords using great circle distance formula |
| void |
getAddDirectionsJS() |
function to render proper calls for directions - for now can only be used on a map, not a streetview |
| void |
getAddMarkersJS() |
overridable function for generating js to add markers |
| bool|array |
getCache() |
get the geocode lat/lon points from cache for given address |
| void |
getCreateMarkerJS() |
overridable function to generate the js for the js function for creating a marker. |
| array |
getGeocode() |
get the geocode lat/lon points from given address look in cache first, otherwise get from Yahoo |
| void |
getHeaderJS() |
return map header javascript (goes between <head></head>) |
| void |
getMapFunctions() |
function to render utility functions for use on the page |
| void |
getOnLoad() |
return js to set onload function |
| void |
getPolylineJS() |
overridable function to generate polyline js - for now can only be used on a map, not a streetview |
| void |
printHeaderJS() |
print map header javascript (goes between <head></head>) |
| void |
printMap() |
print map (put at location map will appear) |
| void |
printMapJS() |
print map javascript (put just before </body>, or in <header> if using onLoad()) |
| void |
printOnLoad() |
prints onLoad() without having to manipulate body tag. |
| void |
printSidebar() |
print sidebar (put at location sidebar will appear) |
| bool |
putCache() |
put the geocode lat/lon points into cache for given address |
| void |
setDSN() |
sets the PEAR::DB dsn |
| string|false |
setHeight() |
sets the height of the map |
| void |
setJSAlert() |
set <noscript> message when javascript is disabled |
| void |
setLookupService() |
set the lookup service to use for geocode lookups default is YAHOO, you can also use GOOGLE. |
| void |
setMapType() |
set default map type (map/satellite/hybrid) |
| string |
setMarkerIcon() |
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. |
| string |
setMarkerIconKey() |
function to check if icon is in class "marker_iconset", if it is, |
| string|false |
setWidth() |
sets the width of the map |
Properties
Google Adsense Channel ID
enables Google Adsense Adsmanager on page, not currently supported in beta
The Max number of Adsmanager ads to show on a map
Google Adsense Publisher ID
DEPRECATED: Google now has geocoding service.
NOTE: Note even sure if this still works GoogleMapAPI used to use the Yahoo geocode lookup API. This is the application ID for YOUR application. This is set upon instantiating the GoogleMapAPI object. (http://developer.yahoo.net/faq/index.html#appid)
enables/disables avoid highways on directions
determines if avoid tollways is used in directions
enables/disables biking directions on directions
determines if biking overlay is displayed on map
factor by which to fudge the boundaries so that when we zoom encompass, the markers aren't too close to the edge
message that pops up when the browser is incompatible with Google Maps.
set to empty string to disable.
map center latitude (horizontal) calculated automatically as markers are added to the map.
map center longitude (vertical) calculated automatically as markers are added to the map.
determines the map control type small -> show move/center controls large -> show move/center/zoom controls
Default icon image location.
Default icon shadow image location.
determines if to/from directions are included inside info window
API Tags:
determines unit system to use for directions, blank = default
determines whether or not to display the map and associated JS on the page
this is used if you just want to display a streetview with no map
PEAR::DB DSN for geocode caching. example: $dsn = 'mysql://user:pass@localhost/dbname';
determines whether or not to display an elevation chart for directions that are added to the map.
determines whether or not to display a marker on the "line" when
mousing over the elevation chart
determines the map height
determines if map markers bring up an info window
message that appears when javascript is disabled.
set to empty string to disable.
Class variable for localization
enables/disables local search on page
enables local search ads on page NOTE: will only display ads if local_search == true, otherwise just use ad_manager and settings.
what server geocode lookups come from
available: YAHOO Yahoo! API. US geocode lookups only. GOOGLE Google Maps. This can do international lookups, but not an official API service so no guarantees. Note: GOOGLE is the default lookup service, please read the Yahoo! terms of service before using their API.
enables map controls (zoom/move/center)
current map id, set when you instantiate the GoogleMapAPI object.
default map type google.maps.MapTypeId.(ROADMAP, SATELLITE, HYBRID, TERRAIN)
determines whether or not to use the MarkerClusterer plugin
set default marker clusterer *webserver* file location
set default marker clusterer options
Whether to use new V3 mobile functionality
use onLoad() to load the map javascript.
if enabled, be sure to include on your webpage: <?=$mapobj->printOnLoad?> or manually create an onload function that calls the map's onload function using $this->printOnLoadFunction
enables overview map control
enables scale map control
class variable to control scrollwheel
determines if sidebar is enabled
sidebar <div> used along with this map.
determines whether or not to display street view controls
ID of the container that will hold a street view if streetview controls = true.
determines if traffic overlay is displayed on map
enables map type controls (map/satellite/hybrid/terrain)
sets default option control selections (ROADMAP, SATELLITE, HYBRID, TERRAIN)
sets default option for controls positin (TOP_LEFT, TOP_RIGHT, etc.)
sets default option for type controls(DEFAULT, HORIZONTAL_BAR, DROPDOWN_MENU)
use the first suggestion by a google lookup if exact match not found
enables/disables walking directions option
determines if info window appears with a click or mouseover
determines the default zoom level
determines if we should zoom to minimum level (above this->zoom value) that will encompass all markers
database cache table name
Class variable that will store information to render directions
Class variable that will store generated header code for JS to display directions
Class variable to store whether or not to display JS functions in the header
list of polylines that should have an elevation profile rendered.
icon info array
API Tags:
Information Tags:
list of added kml overlays
marker icon info array
Information Tags:
maximum longitude of all markers
Class variable that will store flag to minify js - this can be overwritten after object is instantiated. Include JSMin.php if you want to use JS Minification.
minimum longitude of all markers
#)MS list of added polygon
Methods
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: |
|
string addPolygonByCoords(
string
$lon1, string
$lat1, string
$lon2, string
$lat2, [string
$id = false], [string
$color = ''], [string
$weight = 0], [string
$opacity = 0], [string
$fill_color = ''], [string
$fill_opacity = 0]
)
|
|
#)MS adds a map polygon 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 border line (format: #000000) |
|
string |
$weight: |
the weight of the line in pixels |
|
string |
$opacity: |
the border line opacity (percentage) |
|
string |
$fill_color: |
the polygon color (format: #000000) |
|
string |
$fill_opacity: |
the polygon opacity (percentage) |
API Tags:
| Return: | id of the created/updated polyline array |
bool|int addPolygonByCoordsArray(
$polygon_array, [string
$id = false], [string
$color = ''], [string
$weight = 0], [string
$opacity = 0], [string
$fill_color = ''], [string
$fill_opacity = 0], array
$polyline_array
)
|
|
#)MS
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) |
|
string |
$fill_color: |
the polygon color (format: #000000) |
|
string |
$fill_opacity: |
the polygon opacity (percentage) |
|
|
$polygon_array: |
|
API Tags:
| Return: | Array id of newly added point or false |
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
#)MS
overridable function to generate polyline js - for now can only be used on a map, not a streetview
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 setTypeControlPosition(
$pos
)
|
|
Parameters:
void setTypeControlsStyle(
$type
)
|
|
sets map control style
Parameters:
void setTypeControlTypes(
$list
)
|
|
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. |
|
|