Issue description
hello I am using Angular2 Google Maps and i want change my maker label color
code :
<agm-map [zoom]="7" [latitude]="lat" [longitude]="lng" [styles]='[
{
elementType : "labels.text",
stylers : [{
color:"#ffffff"
}]
}]'> <agm-marker>....</agm-marke>
but its set google default label color
please help me ...
You can modify the colour of the marker but passing in properties into the marker itself.
TS:
labelOptions = {
color: '#CC0000',
fontFamily: '',
fontSize: '14px',
fontWeight: 'bold',
text: 'Some Text',
}
@MattPua hello your code working but problem is here
label text is dynamic from for loop.... how to set text from for loop
solved by change css : .gm-style div{color: #fff !important; font-weight: bold;}
@snd1890
Can you share "
@MattPua - It would be great if you can share how to change the label background color? Like this.

If we could also change the position that would be great. A few styles are ignored - backgroundColor and marginTop specifically.
Alternatively, give the div a class name so we can access it with CSS
@Ashokrlz did you find out how to make that change?
Anyone has idea how to change marker image?
I'm using https://developers.google.com/chart/image/docs/gallery/dynamic_icons#icon_types. So just use [iconUrl] param and change it on hover to the icon with text for example like I did
You can use the answer from @MattPua and send a dynamic text, like this:
[label]="{
color: '#ffffff',
fontWeight: 'bold',
text: (i + 1).toString()
}"
@Viktor-Bredihin Could you give an example of how you achieved this?
this simple style works for me to style agm marker label
<agm-map style="text-shadow: 0px 0px 6.2px grey;">
<agm-marker *ngFor="let device of devices" [label]="'anything'"></agm-marker>
</agm-map>
Most helpful comment
You can modify the colour of the marker but passing in properties into the marker itself.
TS:
labelOptions = {
color: '#CC0000',
fontFamily: '',
fontSize: '14px',
fontWeight: 'bold',
text: 'Some Text',
}