Answers.Body: <p>Looks like there are a couple of notable errors in your JS:</p>
  
  <ul>
  <li>You have a semi-colon at the end of your <code>icon</code> line. That should be a comma.</li>
  <li>On the <code>scaledSize</code> line, you have the colon <em>inside</em> the quote. That should be outside.</li>
  <li><em>Added per Robin's comment...</em> Since you're doing this in JS (not Twig), the <code>new google.maps.Size(32,32)</code> shouldn't be enclosed in quotes. Pass in the JS object directly.</li>
  </ul>
  
  <p>Try something like this...</p>
  
  <pre class="lang-js prettyprint-override"><code>{% js %}
      var markerId = 'smartmap-mapcanvas-1.{{ entry.id }}.addressInformation';
      smartMap.marker[markerId].setOptions({
          'icon':       '{{ icon }}',
          'scaledSize': new google.maps.Size(32,32)
      });
  {% endjs %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-17T22:03:20.390Z
Answers.Text: This is the correct answer
Answers.UserDisplayName: Tchick
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-24T16:09:31.010Z
Answers.LastActivityDate: 2018-08-24T16:09:31.010Z
Answers.UserDisplayName: Lindsey D
Answers.Body: <p>You already stated the wrong ; </p>
  
  <p>Aside from that, i managed to change the size in one of my projects, where i had to use a bitmap image, this way:</p>
  
  <pre><code>marker[id] = new google.maps.Marker({
      position: region.pos,
      map: map,
      icon: {url: imageMarker,
              size: new google.maps.Size(52, 52),
              scaledSize: new google.maps.Size(32, 32),
              anchor: new google.maps.Point(15, 35) // offset
              }
  });
  </code></pre>
  
  <p>I didn't use the smartmaps-plugin, but i think that's irelevant.</p>
  
  <p>(The png had a different size, that's the reason <code>size</code> and <code>scaledSize</code> have different values)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-24T12:30:37.193Z
Answers.Text: Tried as suggested. Code seems to be OK, no errors. But unfortunately still no sizing
Answers.UserDisplayName: Robbie Post
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-24T09:40:11.660Z
Answers.LastActivityDate: 2018-08-24T09:40:11.660Z
Answers.UserDisplayName: phaetons
Body: <p>I tried this code, but getting 'unexpected token errors". Probably something to do using incorrect syntax.</p>
  
  <pre class="lang-js prettyprint-override"><code>{% js %}
      var markerId = 'smartmap-mapcanvas-1.{{ entry.id }}.addressInformation';
      smartMap.marker[markerId].setOptions({
          'icon':       '{{ icon }}'; 
          'scaledSize:' 'new google.maps.Size(32,32)'
      });
  {% endjs %}
  </code></pre>
  
  <p>The error in the console</p>
  
  <pre class="lang-js prettyprint-override"><code>var markerId = 'smartmap-mapcanvas-1.550.addressInformation';
  smartMap.marker[markerId].setOptions({
      'icon':       '//d1ado4imyxw3fk.cloudfront.net/html/pin-otto-12.png'; 
      'scaledSize:' 'new google.maps.Size(32,32)'
  })
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-24T07:55:43.423Z
Comments.Text: Did you made mistakes while copy pasting? Because your syntax doesn't seem correct unless smartmap is using `eval` but even so using `;` after object properties is wrong
Comments.UserDisplayName: Robin Schambach
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-24T08:35:01.813Z
Comments.Text: The above is the smart map code as described in the smartmap docu under: Different icons for different marker types. I did make a mistake though with the ; character. After replacing the ; for a , the map reloads without errors. However the icons are still not sized.
Comments.UserDisplayName: Robbie Post
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-24T08:38:45.827Z
Comments.Text: They don't state to do `'new google.maps.Size(32,32)'` because that will pass a string... I can't think of a reason why smartmap expects a string rather than the actual object.
Comments.UserDisplayName: Robin Schambach
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-24T12:54:29.353Z
Comments.Text: it should be: 
  'scaledSize': new google.maps.Size(32,32)
  
  (wrong postion of the colon, value is not a string)
Comments.UserDisplayName: phaetons
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-24T16:10:58.127Z
Comments.Text: @RobinSchambach Smart Map is actually smart enough to recognize strings that contain `google.maps`, and parse them correctly. :)
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-24T16:11:53.893Z
Comments.Text: Oh, but that would be in Twig... he's using JS here. In that case, you are correct about passing the object directly!
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-17T22:01:14.070Z
Comments.Text: This thread is a little old but I found it helpful in solving this same issue. @LindseyD hit on the solution. Pass the object directly instead of as a string.
  In other words remove the quote marks like this:
  'scaledSize': new google.maps.Size(32,32)
   
  Works for me!
Comments.UserDisplayName: Tchick
Tags: <craft3><plugin-smartmap>
Title: How can I change the size of an individual pin?
ThreadText: # How can I change the size of an individual pin?
  
  (Asked by: username_0 on 2018-08-24)
  
  I tried this code, but getting 'unexpected token errors". Probably something to do using incorrect syntax.
  
  ```js
  {% js %}
      var markerId = 'smartmap-mapcanvas-1.{{ entry.id }}.addressInformation';
      smartMap.marker[markerId].setOptions({
          'icon':       '{{ icon }}'; 
          'scaledSize:' 'new google.maps.Size(32,32)'
      });
  {% endjs %}
  
  ```
  
  The error in the console
  
  ```js
  var markerId = 'smartmap-mapcanvas-1.550.addressInformation';
  smartMap.marker[markerId].setOptions({
      'icon':       '//d1ado4imyxw3fk.cloudfront.net/html/pin-otto-12.png'; 
      'scaledSize:' 'new google.maps.Size(32,32)'
  })
  
  ```
  
  **Tags:** craft3, plugin-smartmap
  
  > **Comments:**
  > **username_1**: Did you made mistakes while copy pasting? Because your syntax doesn't seem correct unless smartmap is using `eval` but even so using `;` after object properties is wrong  
  > **username_0**: The above is the smart map code as described in the smartmap docu under: Different icons for different marker types. I did make a mistake though with the ; character. After replacing the ; for a , the map reloads without errors. However the icons are still not sized.  
  > **username_1**: They don't state to do `'new google.maps.Size(32,32)'` because that will pass a string... I can't think of a reason why smartmap expects a string rather than the actual object.  
  > **username_2**: it should be:  'scaledSize': new google.maps.Size(32,32)  (wrong postion of the colon, value is not a string)  
  > **username_3**: @username_1 Smart Map is actually smart enough to recognize strings that contain `google.maps`, and parse them correctly. :)  
  > **username_3**: Oh, but that would be in Twig... he's using JS here. In that case, you are correct about passing the object directly!  
  > **username_4**: This thread is a little old but I found it helpful in solving this same issue. @username_3 hit on the solution. Pass the object directly instead of as a string. In other words remove the quote marks like this: 'scaledSize': new google.maps.Size(32,32)   Works for me!  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2018-08-24. Score: 3
  
  Looks like there are a couple of notable errors in your JS:
  
  * You have a semi-colon at the end of your `icon` line. That should be a comma.
  * On the `scaledSize` line, you have the colon *inside* the quote. That should be outside.
  * *Added per username_1's comment...* Since you're doing this in JS (not Twig), the `new google.maps.Size(32,32)` shouldn't be enclosed in quotes. Pass in the JS object directly.
  
  Try something like this...
  
  ```js
  {% js %}
      var markerId = 'smartmap-mapcanvas-1.{{ entry.id }}.addressInformation';
      smartMap.marker[markerId].setOptions({
          'icon':       '{{ icon }}',
          'scaledSize': new google.maps.Size(32,32)
      });
  {% endjs %}
  
  ```
  
  > **Comments:**
  > **username_4**: This is the correct answer  
  
  ---
  
  ### Answer by username_2 on 2018-08-24. Score: 1
  
  You already stated the wrong ;
  
  Aside from that, i managed to change the size in one of my projects, where i had to use a bitmap image, this way:
  
  ```
  marker[id] = new google.maps.Marker({
      position: region.pos,
      map: map,
      icon: {url: imageMarker,
              size: new google.maps.Size(52, 52),
              scaledSize: new google.maps.Size(32, 32),
              anchor: new google.maps.Point(15, 35) // offset
              }
  });
  
  ```
  
  I didn't use the smartmaps-plugin, but i think that's irelevant.
  
  (The png had a different size, that's the reason `size` and `scaledSize` have different values)
  
  > **Comments:**
  > **username_0**: Tried as suggested. Code seems to be OK, no errors. But unfortunately still no sizing  
  
  ---
  
  