Body: <p>I'm trying to output a static map from a smart map field in a matrix. I can output a dynamic map with no issues, but the static map code isn't working.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>{% set locations = entry.locationsAndNotes %}
  {% set options = {
      width: 370,
      height: 208,
      zoom: 16,
  } %}
  {{ craft.smartMap.img(locations[0], options) }}
  </code></pre>
  
  <p>The url it outputs looks like this: <a href="https://maps.googleapis.com/maps/api/staticmap?visual_refresh=true&amp;key=myKey&amp;scale=2&amp;center=-48.876667,-123.393333&amp;size=370x208&amp;maptype=roadmap&amp;zoom=16" rel="nofollow noreferrer">https://maps.googleapis.com/maps/api/staticmap?visual_refresh=true&amp;key=myKey&amp;scale=2&amp;center=-48.876667,-123.393333&amp;size=370x208&amp;maptype=roadmap&amp;zoom=16</a>
  Pasted into a browser, i get an error that the API server rejected my request because it is missing the size parameter.</p>
  
  <p>If I change all of the <code>&amp;amp</code> to &amp;, an image loads, but it's just a blank blue map.</p>
  
  <p>It seems like this should work, since I can render a dynamic map, but I'm not sure if it's an issue with my code, or the plugin, or the api.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-12T19:33:45.703Z
Comments.Text: If you change `craft.smartMap.img` to `craft.smartMap.map`, you're saying it loads the dynamic map properly? Does the marker appear in the correct spot?
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-12T19:49:05.697Z
Comments.Text: @LindseyD Yes, changing it to craft.smartMap.map loads the dynamic map with the marker in the correct spot.
Comments.UserDisplayName: artmem
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-12T20:05:28.530Z
Comments.Text: Looks like a bug... contact support@doublesecretagency.com.
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-01-25T17:31:24.270Z
Comments.Text: for anyone else that comes across this issue in the future - I ran into the same problem, and I needed to a) generate a google-maps API key and b) *enable certain APIs* in the google api settings - do the stuff on this page: https://plugins.doublesecretagency.com/smart-map/get-google-api-keys/ - the Google Static Maps API is *not* enabled by default.
Comments.UserDisplayName: SamC
Tags: <plugin-smartmap><google-maps>
Title: Smart Maps problems displaying static maps
ThreadText: # Smart Maps problems displaying static maps
  
  (Asked by: username_0 on 2017-09-12)
  
  I'm trying to output a static map from a smart map field in a matrix. I can output a dynamic map with no issues, but the static map code isn't working.
  
  Here is my code:
  
  ```
  {% set locations = entry.locationsAndNotes %}
  {% set options = {
      width: 370,
      height: 208,
      zoom: 16,
  } %}
  {{ craft.smartMap.img(locations[0], options) }}
  
  ```
  
  The url it outputs looks like this: <https://maps.googleapis.com/maps/api/staticmap?visual_refresh=true&key=myKey&scale=2&center=-48.876667,-123.393333&size=370x208&maptype=roadmap&zoom=16>
  Pasted into a browser, i get an error that the API server rejected my request because it is missing the size parameter.
  
  If I change all of the `&amp` to &, an image loads, but it's just a blank blue map.
  
  It seems like this should work, since I can render a dynamic map, but I'm not sure if it's an issue with my code, or the plugin, or the api.
  
  **Tags:** plugin-smartmap, google-maps
  
  > **Comments:**
  > **username_1**: If you change `craft.smartMap.img` to `craft.smartMap.map`, you're saying it loads the dynamic map properly? Does the marker appear in the correct spot?  
  > **username_0**: @username_1 Yes, changing it to craft.smartMap.map loads the dynamic map with the marker in the correct spot.  
  > **username_1**: Looks like a bug... contact support@doublesecretagency.com.  
  > **username_2**: for anyone else that comes across this issue in the future - I ran into the same problem, and I needed to a) generate a google-maps API key and b) *enable certain APIs* in the google api settings - do the stuff on this page: https://plugins.doublesecretagency.com/smart-map/get-google-api-keys/ - the Google Static Maps API is *not* enabled by default.  
  
  ---
  
  ## 0 answers
  
  