Title Of A Marker Of Google Map Marker Api
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 = '
Solution 1:
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);
});
Solution 2:
A "title" is a tooltip that is automatically created for the google.maps.Marker object. It doesn't support HTML markup. If you want to create one that is different from the default, you can, but it would be custom.
See this post for one custom tool tip option (a google search found 2 posts describing them).
Post a Comment for "Title Of A Marker Of Google Map Marker Api"