Skip to content

Instantly share code, notes, and snippets.

@tjhole
Created December 12, 2013 18:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjhole/7933264 to your computer and use it in GitHub Desktop.
Save tjhole/7933264 to your computer and use it in GitHub Desktop.
ACF: Location > Static Google Map
<?php
$location = get_sub_field('location');
if( !empty($location) ):
?>
<img src="http://maps.googleapis.com/maps/api/staticmap?center=<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>&zoom=15&format=png&sensor=false&size=640x480&maptype=roadmap&visual_refresh=true&style=visibility:off&style=feature:road|element:geometry|visibility:simplified|color:0xefecec&style=feature:landscape|element:geometry|visibility:simplified|color:0xffffff&style=element:labels|visibility:on&markers=color:black|<?php echo $location['lat']; ?>,<?php echo $location['lng']; ?>"/>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment