[ class tree: GoogleMapAPI ] [ index: GoogleMapAPI ] [ all elements ]

Class: GoogleMapAPI

Source Location: /zp-extensions/GoogleMap/GoogleMap.php

Class GoogleMapAPI

Class Overview

PHP Google Maps API class

Located in /zp-extensions/GoogleMap/GoogleMap.php [line 58]



		
				Author(s):
		
Information Tags:
Version:  3.0beta

Properties

Methods

[ Top ]
Property Summary
string   $ads_channel   Google Adsense Channel ID
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   $ads_pub_id   Google Adsense Publisher ID
string   $app_id   DEPRECATED: Google now has geocoding service.
bool   $avoid_highways   enables/disables avoid highways on directions
bool   $avoid_tollways   determines if avoid tollways is used in directions
bool   $biking_directions   enables/disables biking directions on directions
bool   $biking_overlay   determines if biking overlay is displayed on map
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
string   $default_icon   Default icon image location.
string   $default_icon_shadow   Default icon shadow image location.
bool   $directions   determines if to/from directions are included inside info window
string   $directions_unit_system   determines unit system to use for directions, blank = default
mixed   $display_map   determines whether or not to display the map and associated JS on the page
array   $driving_dir_text  
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.
mixed   $elevation_markers   determines whether or not to display a marker on the "line" when
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   enables/disables local search on page
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.
mixed   $lookup_server  
string   $lookup_service   what server geocode lookups come from
bool   $map_controls   enables map controls (zoom/move/center)
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)
mixed   $marker_clusterer   determines whether or not to use the MarkerClusterer plugin
mixed   $marker_clusterer_location   set default marker clusterer *webserver* file location
mixed   $marker_clusterer_options   set default marker clusterer options
bool   $mobile   Whether to use new V3 mobile functionality
bool   $onload   use onLoad() to load the map javascript.
bool   $overview_control   enables overview map control
bool   $scale_control   enables scale map control
bool   $scrollwheel   class variable to control scrollwheel
bool   $sidebar   determines if sidebar is enabled
string   $sidebar_id   sidebar <div> used along with this map.
mixed   $street_view_controls   determines whether or not to display street view controls
mixed   $street_view_dom_id   ID of the container that will hold a street view if streetview controls = true.
bool   $traffic_overlay   determines if traffic overlay is displayed on map
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_position   sets default option for controls positin (TOP_LEFT, TOP_RIGHT, etc.)
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
bool   $walking_directions   enables/disables walking directions option
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
string   $_db_cache_table   database cache table name
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
mixed   $_display_js_functions   Class variable to store whether or not to display JS functions in the header
mixed   $_elevation_polylines   list of polylines that should have an elevation profile rendered.
array   $_icons   icon info array
mixed   $_kml_overlays   list of added kml overlays
array   $_markers   list of added markers
array   $_marker_icons   marker icon info array
float   $_max_lat   max latitude
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_lat   min latitude
float   $_min_lon   minimum longitude of all markers
array   $_overlays   list of added overlays
array   $_polygons   #)MS list of added polygon
array   $_polylines   list of added polylines
string   $_version   version number

[ Top ]
Method Summary
GoogleMapAPI   GoogleMapAPI()   class constructor
void   addDirections()   Add directions route to the map and adds text directions container with id=$dom_id
string   addIcon()   add an icon to "iconset"
void   addKMLOverlay()   function to add a KML overlay to the map.
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   addPolygonByCoordsArray()   #)MS
bool|int   addPolyLineByAddress()   adds a map polyline by address if color, weight and opacity are not defined, use the google maps defaults
bool|int   addPolylineByAddressArray()   adds polyline by passed array
string   addPolyLineByCoords()   adds a map polyline by map coordinates if color, weight and opacity are not defined, use the google maps defaults
bool|int   addPolylineByCoordsArray()   adds polyline by passed array
void   addPolylineElevation()   function to add an elevation profile for a polyline to the page
void   adjustCenterCoords()   adjust map center coordinates by the given lat/lon point
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   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   disableOnLoad()   disables onload
void   disableOverviewControl()   disables the overview map control
void   disableScaleControl()   disables the scale map control
void   disableScrollWheel()   disable mouse scrollwheel on Map
void   disableSidebar()   disables sidebar
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
void   enableAds()   enable Google Adsense admanager on Map (not supported in V3 API)
void   enableAvoidHighways()   enables avoid highways in directions
void   enableAvoidTolls()   enables avoid tolls in directions
void   enableBikingDirections()   enables biking directions
void   enableBikingOverlay()   enable biking overlay
void   enableClustering()   enable map marker clustering
void   enableDirections()   enables map directions inside info window
void   enableElevationDirections()   enable elevation to be displayed for directions
void   enableElevationMarker()   enable elevation marker to be displayed
void   enableInfoWindow()   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)
void   enableMapDisplay()   function to enable map display
void   enableOnLoad()   enables onload
void   enableOverviewControl()   enables the overview map control
void   enableScaleControl()   enables the scale map control
void   enableSidebar()   enables sidebar
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()   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
void   getAddOverlayJS()   function to get overlay creation JS.
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.
void   getCreateOverlayJS()   Get create overlay js
void   getElevationMarkerJS()   create JS that is inside of JS plot elevation function
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>)
string   getIconKey()   function to get icon key
void   getMap()   return map
void   getMapFunctions()   function to render utility functions for use on the page
void   getMapJS()   return map javascript
void   getOnLoad()   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
void   getPolygonJS()   #)MS
void   getPolylineJS()   overridable function to generate polyline js - for now can only be used on a map, not a streetview
void   getSidebar()   return sidebar html
void   getUtilityFunctions()  
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   printOnLoadFunction()   print onLoad function name
void   printSidebar()   print sidebar (put at location sidebar will appear)
bool   putCache()   put the geocode lat/lon points into cache for given address
void   setBoundsFudge()   set the boundary fudge factor
void   setBrowserAlert()   set browser alert message for incompatible browsers
void   setCenterCoords()   set map center coordinates to lat/lon point
void   setClusterLocation()   Set clustering library file location
void   setClusterOptions()   set clustering options
void   setControlSize()   sets the map control size (large/small)
void   setDSN()   sets the PEAR::DB dsn
string|false   setHeight()   sets the height of the map
void   setInfoWindowTrigger()   set the info window trigger action
void   setJSAlert()   set <noscript> message when javascript is disabled
void   setLocale()  
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,
void   setTypeControlPosition()  
void   setTypeControlsStyle()   sets map control style
void   setTypeControlTypes()  
string|false   setWidth()   sets the width of the map
void   setZoomLevel()   sets the default map zoom level
void   updateMarkerIconKey()   updates a marker's icon key.

[ Top ]
Properties
string   $ads_channel = "" [line 218]

Google Adsense Channel ID


[ Top ]
bool   $ads_manager = false [line 204]

enables Google Adsense Adsmanager on page, not currently supported in beta


[ Top ]
int   $ads_max = 10 [line 225]

The Max number of Adsmanager ads to show on a map


[ Top ]
string   $ads_pub_id = "" [line 211]

Google Adsense Publisher ID


[ Top ]
string   $app_id = null [line 106]

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)


[ Top ]
bool   $avoid_highways = false [line 260]

enables/disables avoid highways on directions


[ Top ]
bool   $avoid_tollways = false [line 267]

determines if avoid tollways is used in directions


[ Top ]
bool   $biking_directions = false [line 253]

enables/disables biking directions on directions


[ Top ]
bool   $biking_overlay = false [line 366]

determines if biking overlay is displayed on map


[ Top ]
float   $bounds_fudge = 0.01 [line 464]

factor by which to fudge the boundaries so that when we zoom encompass, the markers aren't too close to the edge


[ Top ]
string   $browser_alert = 'Sorry, the Google Maps API is not compatible with this browser.' [line 296]

message that pops up when the browser is incompatible with Google Maps.

set to empty string to disable.


[ Top ]
float   $center_lat = null [line 126]

map center latitude (horizontal) calculated automatically as markers are added to the map.


[ Top ]
float   $center_lon = null [line 135]

map center longitude (vertical) calculated automatically as markers are added to the map.


[ Top ]
string   $control_size = 'large' [line 151]

determines the map control type small -> show move/center controls large -> show move/center/zoom controls


[ Top ]
string   $default_icon = "" [line 526]

Default icon image location.


[ Top ]
string   $default_icon_shadow = "" [line 533]

Default icon shadow image location.


[ Top ]
bool   $directions = true [line 319]

determines if to/from directions are included inside info window

API Tags:
Deprecated:  


[ Top ]
string   $directions_unit_system = '' [line 164]

determines unit system to use for directions, blank = default


[ Top ]
mixed   $display_map = true [line 80]

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


[ Top ]
array   $driving_dir_text = array(
'dir_to' => 'Start address: (include addr, city st/region)',
'to_button_value' => 'Get Directions',
'to_button_type' => 'submit',
'dir_from' => 'End address: (include addr, city st/region)',
'from_button_value' => 'Get Directions',
'from_button_type' => 'submit',
'dir_text' => 'Directions: ',
'dir_tohere' => 'To here',
'dir_fromhere' => 'From here'
)
[line 397]
API Tags:
Deprecated:  


[ Top ]
string   $dsn = null [line 66]

PEAR::DB DSN for geocode caching. example: $dsn = 'mysql://user:pass@localhost/dbname';


[ Top ]
mixed   $elevation_directions = false [line 502]

determines whether or not to display an elevation chart for directions that are added to the map.


[ Top ]
mixed   $elevation_markers = true [line 496]

determines whether or not to display a marker on the "line" when

mousing over the elevation chart


[ Top ]
string   $height = '500px' [line 288]

determines the map height


[ Top ]
bool   $info_window = true [line 326]

determines if map markers bring up an info window


[ Top ]
string   $js_alert = '<b>Javascript must be enabled in order to use Google Maps.</b>' [line 304]

message that appears when javascript is disabled.

set to empty string to disable.


[ Top ]
mixed   $locale = NULL [line 601]

Class variable for localization


[ Top ]
bool   $local_search = false [line 232]

enables/disables local search on page


[ Top ]
bool   $local_search_ads = false [line 239]

enables local search ads on page NOTE: will only display ads if local_search == true, otherwise just use ad_manager and settings.


[ Top ]
mixed   $lookup_server = array('GOOGLE' => 'maps.google.com', 'YAHOO' => 'api.local.yahoo.com') [line 390]

[ Top ]
string   $lookup_service = 'GOOGLE' [line 389]

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.


[ Top ]
bool   $map_controls = true [line 142]

enables map controls (zoom/move/center)


[ Top ]
string   $map_id = null [line 74]

current map id, set when you instantiate the GoogleMapAPI object.


[ Top ]
string   $map_type = 'HYBRID' [line 178]

default map type google.maps.MapTypeId.(ROADMAP, SATELLITE, HYBRID, TERRAIN)


[ Top ]
mixed   $marker_clusterer = false [line 338]

determines whether or not to use the MarkerClusterer plugin


[ Top ]
mixed   $marker_clusterer_location = "/MarkerClusterer-1.0/markerclusterer_compiled.js" [line 343]

set default marker clusterer *webserver* file location


[ Top ]
mixed   $marker_clusterer_options = array(
"maxZoom"=>"null",
"gridSize"=>"null",
"styles"=>"null"
)
[line 348]

set default marker clusterer options


[ Top ]
bool   $mobile = false [line 94]

Whether to use new V3 mobile functionality


[ Top ]
bool   $onload = true [line 117]

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


[ Top ]
bool   $overview_control = false [line 197]

enables overview map control


[ Top ]
bool   $scale_control = true [line 185]

enables scale map control


[ Top ]
bool   $scrollwheel = true [line 190]

class variable to control scrollwheel


[ Top ]
bool   $sidebar = true [line 311]

determines if sidebar is enabled


[ Top ]
string   $sidebar_id = null [line 87]

sidebar <div> used along with this map.


[ Top ]
mixed   $street_view_controls = false [line 371]

determines whether or not to display street view controls


[ Top ]
mixed   $street_view_dom_id = "" [line 376]

ID of the container that will hold a street view if streetview controls = true.


[ Top ]
bool   $traffic_overlay = false [line 359]

determines if traffic overlay is displayed on map


[ Top ]
bool   $type_controls = true [line 158]

enables map type controls (map/satellite/hybrid/terrain)


[ Top ]
string   $type_controls_list = array('ROADMAP', 'SATELLITE', 'HYBRID', 'TERRAIN') [line 596]

sets default option control selections (ROADMAP, SATELLITE, HYBRID, TERRAIN)


[ Top ]
string   $type_controls_position = "TOP_RIGHT" [line 590]

sets default option for controls positin (TOP_LEFT, TOP_RIGHT, etc.)


[ Top ]
string   $type_controls_style = "DEFAULT" [line 171]

sets default option for type controls(DEFAULT, HORIZONTAL_BAR, DROPDOWN_MENU)


[ Top ]
float   $use_suggest = false [line 471]

use the first suggestion by a google lookup if exact match not found


[ Top ]
bool   $walking_directions = false [line 246]

enables/disables walking directions option


[ Top ]
string   $width = '500px' [line 281]

determines the map width


[ Top ]
string   $window_trigger = 'click' [line 333]

determines if info window appears with a click or mouseover


[ Top ]
int   $zoom = 16 [line 274]

determines the default zoom level


[ Top ]
bool   $zoom_encompass = true [line 457]

determines if we should zoom to minimum level (above this->zoom value) that will encompass all markers


[ Top ]
string   $_db_cache_table = 'GEOCODES' [line 553]

database cache table name


[ Top ]
mixed   $_directions = array() [line 565]

Class variable that will store information to render directions


[ Top ]
string   $_directions_header = '' [line 560]

Class variable that will store generated header code for JS to display directions


[ Top ]
mixed   $_display_js_functions = true [line 570]

Class variable to store whether or not to display JS functions in the header


[ Top ]
mixed   $_elevation_polylines = array() [line 490]

list of polylines that should have an elevation profile rendered.


[ Top ]
array   $_icons = array() [line 511]

icon info array

API Tags:
Deprecated:  

Information Tags:
Version:  2.5

[ Top ]
mixed   $_kml_overlays = array() [line 545]

list of added kml overlays


[ Top ]
array   $_markers = array() [line 422]

list of added markers


[ Top ]
array   $_marker_icons = array() [line 519]

marker icon info array

Information Tags:
Version:  3.0

[ Top ]
float   $_max_lat = -1000000 [line 443]

max latitude


[ Top ]
float   $_max_lon = -1000000 [line 429]

maximum longitude of all markers


[ Top ]
bool   $_minify_js = true [line 578]

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.


[ Top ]
float   $_min_lat = 1000000 [line 450]

min latitude


[ Top ]
float   $_min_lon = 1000000 [line 436]

minimum longitude of all markers


[ Top ]
array   $_overlays = array() [line 540]

list of added overlays


[ Top ]
array   $_polygons = array() [line 478]

#)MS list of added polygon


[ Top ]
array   $_polylines = array() [line 485]

list of added polylines


[ Top ]
string   $_version = '3.0beta' [line 415]

version number


[ Top ]
Methods
Constructor GoogleMapAPI  [line 629]

  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


[ Top ]
addDirections  [line 845]

  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: 


[ Top ]
addIcon  [line 1607]

  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.


[ Top ]
addKMLOverlay  [line 1459]

  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:
   $file: 


[ Top ]
addMarkerByAddress  [line 1230]

  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


[ Top ]
addMarkerByCoords  [line 1248]

  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


[ Top ]
addMarkerOpener  [line 1279]

  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


[ Top ]
addOverlay  [line 1433]

  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: 


[ Top ]
addPolygonByCoords  [line 2721]

  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


[ Top ]
addPolygonByCoordsArray  [line 2771]

  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


[ Top ]
addPolyLineByAddress  [line 1357]

  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


[ Top ]
addPolylineByAddressArray  [line 1328]

  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


[ Top ]
addPolyLineByCoords  [line 1379]

  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


[ Top ]
addPolylineByCoordsArray  [line 1297]

  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


[ Top ]
addPolylineElevation  [line 1418]

  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: 


[ Top ]
adjustCenterCoords  [line 1470]

  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)


[ Top ]
attachStreetViewContainer  [line 1035]

  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:
   $dom_id: 


[ Top ]
createMarkerIcon  [line 1507]

  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.


[ Top ]
disableAds  [line 1049]

  void disableAds( )

disable Google Adsense admanager on Map (not supported in V3 API)



[ Top ]
disableAvoidHighways  [line 817]

  void disableAvoidHighways( )

disables avoid highways in directions



[ Top ]
disableAvoidTolls  [line 833]

  void disableAvoidTolls( )

disables avoid tolls in directions



[ Top ]
disableBikingDirections  [line 801]

  void disableBikingDirections( )

disables biking directions



[ Top ]
disableBikingOverlay  [line 1013]

  void disableBikingOverlay( )

disable biking overlay (default)



[ Top ]
disableClustering  [line 1106]

  void disableClustering( )

disable map marker clustering



[ Top ]
disableDirections  [line 967]

  void disableDirections( )

disables map directions inside info window



[ Top ]
disableElevationDirections  [line 1092]

  void disableElevationDirections( )

disable elevation to be displayed for directions



[ Top ]
disableElevationMarker  [line 1078]

  void disableElevationMarker( )

disable elevation marker



[ Top ]
disableInfoWindow  [line 1064]

  void disableInfoWindow( )

disable map marker info windows



[ Top ]
disableLocalSearch  [line 753]

  void disableLocalSearch( )

disables the type controls (map/satellite/hybrid)



[ Top ]
disableLocalSearchAds  [line 769]

  void disableLocalSearchAds( )

disables the type controls (map/satellite/hybrid)



[ Top ]
disableMapControls  [line 720]

  void disableMapControls( )

disables the map controls (zoom/move)



[ Top ]
disableMapDisplay  [line 645]

  void disableMapDisplay( )

function to disable map display (used to display street view only)



[ Top ]
disableOnLoad  [line 935]

  void disableOnLoad( )

disables onload



[ Top ]
disableOverviewControl  [line 1192]

  void disableOverviewControl( )

disables the overview map control



[ Top ]
disableScaleControl  [line 1176]

  void disableScaleControl( )

disables the scale map control



[ Top ]
disableScrollWheel  [line 737]

  void disableScrollWheel( )

disable mouse scrollwheel on Map



[ Top ]
disableSidebar  [line 951]

  void disableSidebar( )

disables sidebar



[ Top ]
disableStreetViewControls  [line 1027]

  void disableStreetViewControls( )

disable biking overlay (default)



[ Top ]
disableTrafficOverlay  [line 999]

  void disableTrafficOverlay( )

disable traffic overlay (default)



[ Top ]
disableTypeControls  [line 879]

  void disableTypeControls( )

disables the type controls (map/satellite/hybrid)



[ Top ]
disableWalkingDirections  [line 785]

  void disableWalkingDirections( )

disables walking directions



[ Top ]
disableZoomEncompass  [line 1152]

  void disableZoomEncompass( )

disable zoom to encompass makers



[ Top ]
enableAds  [line 1042]

  void enableAds( )

enable Google Adsense admanager on Map (not supported in V3 API)



[ Top ]
enableAvoidHighways  [line 809]

  void enableAvoidHighways( )

enables avoid highways in directions



[ Top ]
enableAvoidTolls  [line 825]

  void enableAvoidTolls( )

enables avoid tolls in directions



[ Top ]
enableBikingDirections  [line 793]

  void enableBikingDirections( )

enables biking directions



[ Top ]
enableBikingOverlay  [line 1006]

  void enableBikingOverlay( )

enable biking overlay



[ Top ]
enableClustering  [line 1099]

  void enableClustering( )

enable map marker clustering



[ Top ]
enableDirections  [line 959]

  void enableDirections( )

enables map directions inside info window



[ Top ]
enableElevationDirections  [line 1085]

  void enableElevationDirections( )

enable elevation to be displayed for directions



[ Top ]
enableElevationMarker  [line 1071]

  void enableElevationMarker( )

enable elevation marker to be displayed



[ Top ]
enableInfoWindow  [line 1057]

  void enableInfoWindow( )

enable map marker info windows



[ Top ]
enableLocalSearch  [line 745]

  void enableLocalSearch( )

enables the type controls (map/satellite/hybrid)



[ Top ]
enableLocalSearchAds  [line 761]

  void enableLocalSearchAds( )

enables the type controls (map/satellite/hybrid)



[ Top ]
enableMapControls  [line 712]

  void enableMapControls( )

enables the map controls (zoom/move)



[ Top ]
enableMapDisplay  [line 638]

  void enableMapDisplay( )

function to enable map display



[ Top ]
enableOnLoad  [line 927]

  void enableOnLoad( )

enables onload



[ Top ]
enableOverviewControl  [line 1184]

  void enableOverviewControl( )

enables the overview map control



[ Top ]
enableScaleControl  [line 1168]

  void enableScaleControl( )

enables the scale map control



[ Top ]
enableSidebar  [line 943]

  void enableSidebar( )

enables sidebar



[ Top ]
enableStreetViewControls  [line 1020]

  void enableStreetViewControls( )

enable biking overlay



[ Top ]
enableTrafficOverlay  [line 992]

  void enableTrafficOverlay( )

enable traffic overlay



[ Top ]
enableTypeControls  [line 871]

  void enableTypeControls( )

enables the type controls (map/satellite/hybrid)



[ Top ]
enableWalkingDirections  [line 777]

  void enableWalkingDirections( )

enables walking directions



[ Top ]
enableZoomEncompass  [line 1145]

  void enableZoomEncompass( )

enable zoom to encompass makers



[ Top ]
fetchURL  [line 2628]

  void fetchURL( string $url  )

fetch a URL. Override this method to change the way URLs are fetched.

Parameters:
string   $url: 


[ Top ]
geoGetCoords  [line 2566]

  bool|array geoGetCoords( string $address, [ $depth = 0]  )

get geocode lat/lon points for given address from Yahoo

Parameters:
string   $address: 
   $depth: 

API Tags:
Return:  false if can't be geocoded, array or geocdoes if successful


[ Top ]
geoGetCoordsFull  [line 2602]

  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:
string   $address: 
   $depth: 

API Tags:
Return:  false if can't be geocoded, array or geocdoes if successful


[ Top ]
geoGetDistance  [line 2644]

  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


[ Top ]
getAddDirectionsJS  [line 2193]

  void getAddDirectionsJS( )

function to render proper calls for directions - for now can only be used on a map, not a streetview



[ Top ]
getAddMarkersJS  [line 2091]

  void getAddMarkersJS( [ $map_id = ""], [ $pano = false]  )

overridable function for generating js to add markers

Parameters:
   $map_id: 
   $pano: 


[ Top ]
getAddOverlayJS  [line 2261]

  void getAddOverlayJS( )

function to get overlay creation JS.



[ Top ]
getCache  [line 2509]

  bool|array getCache( string $address  )

get the geocode lat/lon points from cache for given address

Parameters:
string   $address: 

API Tags:
Return:  False if no cache, array of data if has cache


[ Top ]
getCreateMarkerJS  [line 2276]

  void getCreateMarkerJS( )

overridable function to generate the js for the js function for creating a marker.



[ Top ]
getCreateOverlayJS  [line 2323]

  void getCreateOverlayJS( )

Get create overlay js



[ Top ]
getElevationMarkerJS  [line 2402]

  void getElevationMarkerJS( )

create JS that is inside of JS plot elevation function



[ Top ]
getGeocode  [line 2491]

  array getGeocode( string $address  )

get the geocode lat/lon points from given address look in cache first, otherwise get from Yahoo

Parameters:
string   $address: 

API Tags:
Return:  GeoCode information


[ Top ]
getHeaderJS  [line 1637]

  void getHeaderJS( )

return map header javascript (goes between <head></head>)



[ Top ]
getIconKey  [line 1593]

  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


[ Top ]
getMap  [line 2442]

  void getMap( )

return map



[ Top ]
getMapFunctions  [line 2064]

  void getMapFunctions( )

function to render utility functions for use on the page



[ Top ]
getMapJS  [line 1704]

  void getMapJS( )

return map javascript



[ Top ]
getOnLoad  [line 1681]

  void getOnLoad( )

return js to set onload function



[ Top ]
getOnLoadFunction  [line 1688]

  void getOnLoadFunction( )

return js to set onload function



[ Top ]
getPlotElevationJS  [line 2371]

  void getPlotElevationJS( )

print helper function to draw elevation results as a chart



[ Top ]
getPolygonJS  [line 2679]

  void getPolygonJS( )

#)MS

overridable function to generate polyline js - for now can only be used on a map, not a streetview



[ Top ]
getPolylineJS  [line 2142]

  void getPolylineJS( )

overridable function to generate polyline js - for now can only be used on a map, not a streetview



[ Top ]
getSidebar  [line 2480]

  void getSidebar( )

return sidebar html



[ Top ]
getUtilityFunctions  [line 2072]

  void getUtilityFunctions( )



[ Top ]
printHeaderJS  [line 1629]

  void printHeaderJS( )

print map header javascript (goes between <head></head>)



[ Top ]
printMap  [line 2434]

  void printMap( )

print map (put at location map will appear)



[ Top ]
printMapJS  [line 1696]

  void printMapJS( )

print map javascript (put just before </body>, or in <header> if using onLoad())



[ Top ]
printOnLoad  [line 1667]

  void printOnLoad( )

prints onLoad() without having to manipulate body tag.

call this after the print map like so... $map->printMap(); $map->printOnLoad();



[ Top ]
printOnLoadFunction  [line 1674]

  void printOnLoadFunction( )

print onLoad function name



[ Top ]
printSidebar  [line 2472]

  void printSidebar( )

print sidebar (put at location sidebar will appear)



[ Top ]
putCache  [line 2543]

  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


[ Top ]
setBoundsFudge  [line 1160]

  void setBoundsFudge( float $val  )

set the boundary fudge factor

Parameters:
float   $val: 


[ Top ]
setBrowserAlert  [line 976]

  void setBrowserAlert( string $message  )

set browser alert message for incompatible browsers

Parameters:
string   $message: 


[ Top ]
setCenterCoords  [line 1488]

  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)


[ Top ]
setClusterLocation  [line 1122]

  void setClusterLocation( $file  )

Set clustering library file location

Parameters:
   $file: 


[ Top ]
setClusterOptions  [line 1113]

  void setClusterOptions( [ $zoom = "null"], [ $gridsize = "null"], [ $styles = "null"]  )

set clustering options

Parameters:
   $zoom: 
   $gridsize: 
   $styles: 


[ Top ]
setControlSize  [line 729]

  void setControlSize( string $size  )

sets the map control size (large/small)

Parameters:
string   $size:  Large/Small


[ Top ]
setDSN  [line 654]

  void setDSN( string $dsn  )

sets the PEAR::DB dsn

Parameters:
string   $dsn:  Takes the form of "mysql://user:pass@localhost/db_name"


[ Top ]
setHeight  [line 684]

  string|false setHeight( string $height  )

sets the height of the map

Parameters:
string   $height: 

API Tags:
Return:  Height or false if not a valid value


[ Top ]
setInfoWindowTrigger  [line 1131]

  void setInfoWindowTrigger( $type, string $message  )

set the info window trigger action

Parameters:
string   $message:  click/mouseover
   $type: 


[ Top ]
setJSAlert  [line 985]

  void setJSAlert( string $message  )

set <noscript> message when javascript is disabled

Parameters:
string   $message: 


[ Top ]
setLocale  [line 603]

  void setLocale( $loc  )

Parameters:
   $loc: 


[ Top ]
setLookupService  [line 1206]

  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:
string   $service: 

API Tags:
Deprecated:  


[ Top ]
setMapType  [line 905]

  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)


[ Top ]
setMarkerIcon  [line 1561]

  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.


[ Top ]
setMarkerIconKey  [line 1578]

  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.


[ Top ]
setTypeControlPosition  [line 611]

  void setTypeControlPosition( $pos  )

Parameters:
   $pos: 


[ Top ]
setTypeControlsStyle  [line 886]

  void setTypeControlsStyle( $type  )

sets map control style

Parameters:
   $type: 


[ Top ]
setTypeControlTypes  [line 615]

  void setTypeControlTypes( $list  )

Parameters:
   $list: 


[ Top ]
setWidth  [line 664]

  string|false setWidth( string $width  )

sets the width of the map

Parameters:
string   $width: 

API Tags:
Return:  Width or false if not a valid value


[ Top ]
setZoomLevel  [line 704]

  void setZoomLevel( string $level  )

sets the default map zoom level

Parameters:
string   $level:  Initial zoom level value


[ Top ]
updateMarkerIconKey  [line 1619]

  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.


[ Top ]

Documentation generated on Tue, 20 Dec 2011 16:07:23 +0100 by phpDocumentor 1.4.3