Given a google maps marker how can I change the title ?
var _marker = new google.maps.Marker({
position: aPoint,
map: mmap,
title:"old title"
});
I have tried
_marker.setTitle("new title");
and
_marker.title = "new title";
but the title is still "old title"
In API v3 it would be:
marker.setTitle('new title');
Googling your question suggests this:
The information is not held in the marker.title property. Where it is held varies from release to release. In v2.129e it's held in marker.$.title. Also, the information is only processed when you addOverlay the marker. So in v2,129e you can write: marker.$.title = "updated title"; map.removeOverlay(marker); map.addOverlay(marker);
(original answer by Mike Williams of Blackpool, UK)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With