If you have ever needed a way to include Google Maps functionality into your project you should know what is Phoogle. There is also GoogleMap plugin for Symfony but I was not able to make it adding a point to a map based on lang an long values.
So it’s good to know that there is Phoogle php class which is going it simplify the life for developer:
Here is what they wrote about theirselves:
Phoogle Maps (pronounced like Foogle Maps) is a PHP class that integrates itself with the Google Maps API and with the Google Geocoding API to make an easy to use interface to display Google Maps on your site. With about 5 lines of PHP code you can display a customized Google Map on your website. Please note that you will need a free Google Maps API Key to use Phoogle Maps
And that’s the truth. If you need to have a quick way to display a point on world map – IMHO the easiest way is to use Phoogle.
Here is a trick for this (I found it on symfony forum, btw):
So you have to have this code in your layout.php template:
<?php if (has_slot(‘gmapheader’)): ?>
<?php include_slot(‘gmapheader’) ?>
<?php endif; ?>
Now dont forget to put phoogle class files into your lib/ folder.
And next step – for the pages where you want to show Google Map insert the following code into templates:
$map = new PhoogleMap();
$map->addGeoPoint($lat, $lon, ‘It is here!’);