Reputation: 1
How can I add a class or ID to an Overlay in the Google Maps API? Example:
subOverlay.prototype.onAdd = function() {
var div = document.createElement('DIV');
div.addClass="map_marker"; // I try
this.div_ = div;
var panes = this.getPanes();
panes.overlayImage.appendChild(div);
}
But not working :( Please help me
Upvotes: 0
Views: 1024
Reputation: 165951
You have got the wrong property. It's className
, not addClass
:
div.className = "map_marker";
You may have been thinking of the jQuery method, addClass
, in which case you would need to call the method, rather than assigning to it.
Upvotes: 1