Google maps Google Maps MarkerLabel不是一个函数

Google maps Google Maps MarkerLabel不是一个函数,google-maps,google-maps-api-3,Google Maps,Google Maps Api 3,我想知道如何添加一个 我可以得到一个标准的标记来显示,但是当我尝试添加时标记到标记,我得到google.maps.MarkerLabel不是一个函数 var marker = new google.maps.Marker({ animation: google.maps.Animation.DROP, label: new google.maps.MarkerLabel({ text: '!' }), map: myMap, positio

我想知道如何添加一个

我可以得到一个标准的标记来显示,但是当我尝试添加
标记到标记,我得到
google.maps.MarkerLabel不是一个函数

var marker = new google.maps.Marker({
    animation: google.maps.Animation.DROP,
    label: new google.maps.MarkerLabel({
        text: '!'
    }),
    map: myMap,
    position: myMapOptions.center
});
我猜我不能用这种方式实例化一个新的MarkerLabel对象。我应该怎么做才能在标记内得到一个感叹号。

是一个匿名对象规范

var marker = new google.maps.Marker({
    animation: google.maps.Animation.DROP,
    label: {
        text: '!'
    },
    map: myMap,
    position: myMapOptions.center
});

代码片段:

var地理编码器;
var映射;
函数初始化(){
var map=new google.maps.map(
document.getElementById(“地图画布”){
中心:新google.maps.LatLng(37.4419,-122.1419),
缩放:13,
mapTypeId:google.maps.mapTypeId.ROADMAP
});
var marker=new google.maps.marker({
动画:google.maps.animation.DROP,
标签:{
正文:“!”
},
地图:地图,
位置:map.getCenter()
});
}
google.maps.event.addDomListener(窗口“加载”,初始化)
html,
身体,
#地图画布{
身高:100%;
宽度:100%;
边际:0px;
填充:0px
}