2

I have a smart map where I'm trying to use linked SVG files for the marker icons. In Safari, the files load at actual size, which in this case is fine, but in Chrome and Edge, they are scaled up, and in Firefox and IE, they don't show up at all.

I tried setting a size using marker options, but it looks like that doesn't support google.maps.MarkerLabel properties:

{% set options = {
    markerOptions: {
        scaledSize: 'new google.maps.Size(50,50)',
    },
} %}

If I replace the SVG icon with PNGs, they work fine in all browsers. Is there a different way to specify the icon size/path for SVGs?

2

Turns out, there was a bug in Smart Map which made this impossible. Fortunately, it's now fixed!

As of Smart Map v2.4.2, it is 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 = {
    markerOptions: {
        icon: {
            url: '/path/to/svg/file',
            scaledSize: 'new google.maps.Size(50,50)'
        }
    }
} %}

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.