问题:使用google.maps.MarkerLabel创建标签失败
代码:
new google.maps.MarkerLabel({
color: "red",
fontSize: "8px",
text: "why"
});
官方文档:
解决方案:
错误信息已经告诉你了,MarkerLabel不是一个构造函数,另外官方文档明确告诉你了google.maps.MarkerLabel 是一个 interface 而不是一个 class。正确的做法是直接返回一个对象作为marker的label的值。
{
color: colors[eventType],
fontSize: "8px",
text: result
}
标签如此,图片也是。