Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  15] [ 6]  / answers: 1 / hits: 46494  / 11 Years ago, wed, october 9, 2013, 12:00:00

I try to change the color of part of the title, but look like the title option does not take html format. How can I make it work?



Thank you



var testtitle = '<font color=green>This is some text!</font> another text';   

var marker = new google.maps.Marker({
position: location,
title: testtitle,
map: map
});

More From » google-maps

 Answers
21

you must use InfoWindow object



see this doc google map api



var infowindow = new google.maps.InfoWindow({
content: <span>any html goes here</span>
});

var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Uluru (Ayers Rock)'
});

google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});

[#75113] Tuesday, October 8, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mikael

Total Points: 73
Total Questions: 115
Total Answers: 86

Location: Central African Republic
Member since Mon, Aug 10, 2020
4 Years ago
;