2

I'm trying to figure out how to set the size of a marker on a map.

{% set options = {
  zoom: 6,
  markerOptions: {
    icon: 'https://www.mysite.com/images/map/marker.png',
    scaledSize: 'new google.maps.Size(20,20)'
  },
} %}

It pulls in my marker file correctly, but I don't know what the correct option is to make it scale.

It's a 40px square image, but I want it to show at 20px, so it doesn't look like garbage on a retina screen.

Help?

2

As of Smart Map v2.4.2, it is now possible to build more elaborate markers using a nested syntax for the markerOptions value. Download the latest version, then try something like this...

{% set options = {
  zoom: 6,
  markerOptions: {
    icon: {
      url: 'https://www.mysite.com/images/map/marker.png',
      scaledSize: 'new google.maps.Size(20,20)'
    }
  }
} %}
  • 1
    a ha. I hadn't seen the update yet. (I'm on 2.4.1.) Thank you, Lindsey. – SamC Jan 31 '18 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.