Static Google maps

Template method for generating a static Google map image

Simple map example

<img src="{{ get_static_map(location=site.locations[0]) }}" width="680", height="340">

Advanced usage

{{ get_static_map(
  location=site.locations[0],
  width=680,
  height=340,
  scale=2,
  icon="https://www.example.com/some-icon.png",
  zoom=14
) }}

Icon best practices

  • For the custom icon, it should be sized appropriate for the map since you will not have control over the icon width/height.

  • Icon URL needs to be a full url (with http/https)

  • If you are using an uploading image, you can use our image path for the icon.

    • Example: /img/upload/some-uploaded-icon.png

    • When providing an icon image, the max pixels (width multiplied by height) for the image can't exceed 4096. So a normal size is 64x64 pixels or less

Last updated