I m using AGM map. Showing markers and marker icon dynamically. Showing user image as marker icon. The user images are different in size so its showing very large. Cant resize the icon. pls help.
The images are showing like below,
Your "icons" should not be that large in the first place, it would take forever to load. You should resize them on your backend.
@lazarljubenovic , is there any possibility do this by using css?
@lazarljubenovic , actually I want to show user image inside the marker icon.
copy of 517
https://github.com/SebastianM/angular-google-maps/issues/517
Basically you can make an object with the iconUrl for a marker and set the size from your component.ts file
Just make sure the url is correct to your needs
private icon = {
url: require('../../../../assets/images/myImg.png'),
scaledSize: {
height: 40,
width: 20
}
};
Then as part of the marker html tag
<agm-marker [iconUrl="icon">
timcblank is right, this a duplicate of #517; closing as such.
Found this comment by hrdkisback on StackOverflow which lets you dynamically change the map marker icon and specify the size:
[iconUrl]='{"url": marker,"scaledSize": {"height": 10, "width": 10}}'
Most helpful comment
copy of 517
https://github.com/SebastianM/angular-google-maps/issues/517
Basically you can make an object with the iconUrl for a marker and set the size from your component.ts file
Just make sure the url is correct to your needs
Then as part of the marker html tag
<agm-marker [iconUrl="icon">