Bowen
Bowen

Reputation: 197

Google Maps API set icon size

I am having an issue resizing a custom icon/markers on google maps, I want to set the icon size to be 15x15.

You would normally use the below to set the size, but I not sure how to apply this to my custom icon in the fiddle below.

scaledSize: new google.maps.Size(25, 25)

Here is my fiddle http://jsfiddle.net/ww17amv2/82/

Thanks for any help or suggestions.

Upvotes: 5

Views: 17519

Answers (1)

evitt
evitt

Reputation: 300

You need add the size when the icon is set:

        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(locations[i][1], locations[i][2]),
            map: map,
            optimized: false,
            icon: {url:icons[iconCounter], scaledSize: new google.maps.Size(70, 70)},
            title: 'Click to zoom'
        });

See: Change Google map marker icon size

Upvotes: 11

Related Questions