Page 2 of 2

Re: How I integrated Google Maps into my web site to show my office location

Posted: Tue Nov 07, 2006 9:03 pm
by newclear
here is a bit explanation about how i integrate the

I using two user defined tags

First tag holds java script include which should stay in header.

the code is

Code: Select all

/**
* Showing 1 point with Phoogle Maps
* class developed by Justin Johnson <justinjohnson@system7designs.com>
*/

if($_GET[page] == 'map'){
require_once 'plugins/phoogle/phoogle.php';
global $map;
$map = new PhoogleMap();
$map->setAPIKey("ABQIAAAALs5pheQFCZ8HwyJ8gRD_YRSdwRFzTB9UbL5b0H6xdF2yKOjZoRS4HpGIiwRcbmb_YtHxrxFLPfZDvQ");
$map->printGoogleJS(); 
}
next tag holds this code that display the map

Code: Select all

global $map;

$map->addGeoPoint('42.770352', '23.320885', 'Sofia, Bulgaria');
$map->addGeoPoint('43.027741', '25.103416', 'Sevlievo, Bulgaria');
$map->addGeoPoint('42.992343', '25.039215', 'Sennik Bulgaria');
$map->addAddress('Sevlievo, Bulgaria', 'Sevlievo'); 
$map->centerMap('42.992343', '25.039215');
$map->showMap();
i am using addGeoPoint because googlemaps has only satelite map.
You can see the methods in the class and there is an example how to do this with easy.