|
Project Information
Links
|
A PHP5 wrapper class written to easily use the Google Static Maps API. The option also exists to use caching to help circumvent the 1000 unique requests a day limit that Google has on the API. Usage Example (Based of data used in a Google example): <?php
$gmap = new GMapsStaticMap();
$gmap->set_api_key('YOUR GOOGLE MAPS API KEY');
$gmap->set_center(40.709028, -74.018672);
$gmap->set_zoom(14);
$gmap->set_size(400, 400);
$gmap->set_maptype(GMapsStaticMap::MAPTYPE_MOBILE);
$gmap->add_marker(40.702147, -74.015794, GMapsStaticMap::MARKER_COLOUR_BLUE, 's');
$gmap->add_marker(40.711614, -74.012318, GMapsStaticMap::MARKER_COLOUR_GREEN, 'g');
echo '<img src="' . $gmap->get_url() . '"/>';
?>Output:
|