Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generating a Static Google Map with PHP
<?php
$url = 'http://maps.googleapis.com/maps/api/staticmap?';
$bits = array(
'center' => 'Calgary Tower, Calgary, AB, Canada',
'zoom' => '16',
'size' => '800x600',
'maptype' => 'roadmap',
'markers' => 'color:0x576d4e|label:N|49.6967179,-112.8450119',
'sensor' => 'false',
);
echo '<img src="' . $url . http_build_query($bits) . '" alt="" />';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.