Change the marker title
marker.setTitle(title);
name | type | description |
---|---|---|
title | string | new title |
<div id="map_canvas"></div>
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div);
// Add a marker
var marker = map.addMarker({
'position': {
lat: 0,
lng: 0
},
'title': "Click me!"
});
// Show the infoWindow
marker.showInfoWindow();
// Catch the MARKER_CLICK event
marker.on(plugin.google.maps.event.INFO_CLICK, function() {
// Change the marker title
marker.setTitle("Clicked!");
// Redraw (reopen) the infoWindow.
marker.showInfoWindow();
});