Google Map From A KML File

KML is a file format used to display geographic data in an Earth browser such as Google Earth, Google Maps, and Google Maps for mobile. 
KML uses a tag-based structure with nested elements and attributes and is based on the XML standard.
For more information on KML standards can be found at http://code.google.com/apis/kml/documentation/kml_tut.html

$t->map("drawMapFromKML", $mapOptions);

$mapOptions

An array of options including the following settings.
longitudeA string : containing the locations longitude
latitudeA string : containing the locations latitude
kml A string : containing the kml file url / location
zoom

An integer : from 1 to 20, the higher the number the map is more zoomed in. If Blank the default is 16.

type

A string : containing the type of map to display, options include

  • roadmap . If Blank this is the default.
  • satellite
  • terrain
  • hybrid
widthAn integer : The width of the map.If Blank the default is 480px
heightAn integer : The height of the map.If Blank the default is 480px
Example Code
// 
 $options = array(

'longitude' => '151.703274', // location longitude to centre map
'latitude' => '-32.892165', // location latitude to centre map
// This KML file contains all the University of Newcastle's emergency phones.

'kml' => 'http://maps.google.com/maps/ms?msa=0&msid=118298040996036209313.00046a78b38a91b0bf95c&output=kml',

);

$t->map('drawMapFromKML', $options);

return $t->result;