PHPRO.ORG

phproogle::apiKey
This is the users Google API Key. This may also be set using the constructor when a new instance is instanciated.
phproogle::addGoogleMapControl()
This method sets the google map controllers such as zoom control, map control etc. This method may be called multiple times to set multiple controls for the map. Options are:
  • GLargeMapControl
  • GSmallMapControl
  • GSmallZoomControl
  • GScaleControl
  • GMapTypeControl
  • GHierarchicalMapTypeControl
  • GOverviewMapControl
<?php $map->addGoogleMapControl("GSmallMapControl"); ?>
phproogle::mapType
This sets the map type to one of four options:
  • normal
  • satellite
  • hybrid
  • physical
<?php $map->mapType "normal"?>
phproogle::mapCenter
This sets the center of the map within the div bounds. The value is an array containing the latitude and longitude of the map center, in that order.
$map->mapCenter = array(-33.862828, 151.216974); 1
phproogle::mapZoom
This sets the map zoom level. Options are an integer from zero to seventeen ( 0 - 19 ). The zero value is the widest zoom level and shows the whole world. While 19 is the maximum zoom and will show buildings. Each zoom level doubles the zoom. The default value is 12.
phproogle::addMarker()
This function is used to create and place markers upon the map. the addMarker method takes three args.
  • float $latitude
  • float $longitude
  • string $html
The latitude and longitude are both numeric values and the html may be any HTML or text to be placed in the marker baloon.
phproogle::addMarkerAddress()
This method works similar to the phproogle::addMarker() and places a marker upon the map. However, rather than accepting a latitude and longitude to place the marker, this method takes two values.
  • string $address
  • string $html
The address parameter is a simple address such as "2 Rue des Perons Paris France". The html parameter is again, any text or HTML to be placed in the info balloon.
phproogle::mapDivID
When set, this will set the ID of the div that the map resides in. The default value is "map"
phproogle::mapWidth
As the name suggests, this will set the width of the div that the map resides in. The default width is 350 pixels.
phproogle::mapHeight
This will set the height of the div that the map resides in. The default value is 300 pixels.
phproogle::googleJS()
This method returns the javascript string that is used most often in the document head that displays the connecting string with google API Key.
phproogle::drawMap()
This method returns the completed javascript to produce the map itself.