我正在尝试向Google地图添加CSS类或ID,以便将CSS应用于Markers.Ive看到了一些简化的示例,但似乎无法使它们适用于这种情况。这是我认为相关的代码部分。如何为标记分配课程?
if (this.div_ = document.createElement("div"),
this.setBoxStyle_(),
void 0 === this.content_.nodeType ? this.div_.innerHTML = this.getCloseBoxImg_() + this.content_ : (this.div_.innerHTML = this.getCloseBoxImg_(),
this.div_.appendChild(this.content_)),
this.getPanes()[this.pane_].appendChild(this.div_),
this.addClickHandler_(),
this.div_.style.width ? this.fixedWidthSet_ = !0 : 0 !== this.maxWidth_ && this.div_.offsetWidth > this.maxWidth_ ? (this.div_.style.width = this.maxWidth_,
this.div_.style.overflow = "auto",
this.fixedWidthSet_ = !0) : (o = this.getBoxWidths_(),
this.div_.style.width = this.div_.offsetWidth - o.left - o.right + "px",
this.fixedWidthSet_ = !1),
this.panBox_(this.disableAutoPan_),
!this.enableEventPropagation_) {
for (this.eventListeners_ = [],
e = ["mousedown", "mouseover", "mouseout", "mouseup", "click", "dblclick", "touchstart", "touchend", "touchmove"],
t = 0; t < e.length; t++)
this.eventListeners_.push(google.maps.event.addDomListener(this.div_, e[t], s));
this.eventListeners_.push(google.maps.event.addDomListener(this.div_, "mouseover", function(t) {
this.style.cursor = "default"
}))
}
this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", function(t) {
t.returnValue = !1,
t.preventDefault && t.preventDefault(),
i.enableEventPropagation_ || s(t)
}),
google.maps.event.trigger(this, "domready")