Solvedangular google maps How do I resize an icon ?

Issue description
I would like to resize an icon to some predefined size. How should I do that?

Steps to reproduce and a minimal demo of the problem
Current behavior
No option for scaled size present.

Expected/desired behavior
I want to be able to resize an icon.

angular2 & angular2-google-maps version
latest

Other information

20 Answers

✔️Accepted Answer

I am able to use the Icon object against the iconUrl property of the marker.

My icon looks like:

{
      url: require('../images/vehicle-active.png'), // gives a data://<value>
      scaledSize: {
        height: 40,
        width: 40
      }
}

And then I bind this to [iconUrl]. The 'iconUrl' variable may be named poorly, but if you look at source, it just gets passed to the 'icon' property for gmaps.

Other Answers:

Require is not necessary (at least with Ionic)

{
      url: 'assets/img/marker-me.png',
      scaledSize: {
        height: 40,
        width: 40
      }
}

More Issues: