question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to change angular 2 google map marker label color?

See original GitHub issue

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 …

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12

github_iconTop GitHub Comments

19reactions
MattPuacommented, Sep 27, 2017

You can modify the colour of the marker but passing in properties into the marker itself.

<agm-marker [label]=“labelOptions” </agm-marker>

TS:

labelOptions = { color: ‘#CC0000’, fontFamily: ‘’, fontSize: ‘14px’, fontWeight: ‘bold’, text: ‘Some Text’, }

7reactions
imashoksundarcommented, Nov 4, 2017

@MattPua - It would be great if you can share how to change the label background color? Like this.

markerlabel

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change angular 2 google map marker label color?
hello I am using Angular2 Google Maps and i want change my maker label color. code : <agm-map [zoom]="7" [latitude]="lat" [longitude]="lng" ...
Read more >
How to change angular 2 google map marker label color?
You can modify the colour of the marker but passing in properties into the marker itself. <agm-marker [label]="labelOptions". TS: labelOptions = ...
Read more >
How to change the color of Google Maps markers with ...
To add a blue color marker, we need to change the icon of the marker. This is done by adding an icon property...
Read more >
Google map with labelled markers - Cheppers
We can define a custom label to each marker by the label property of the Marker object. If the Marker has label attributes,...
Read more >
Style Reference for Maps JavaScript API - Google Developers
The following JSON style declaration turns all map features to gray, then colors arterial road geometry in blue, and hides landscape labels completely:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found