Markerwithlabel无法创建

时间:2014-10-08 07:23:14

标签: javascript asp.net-mvc google-maps-api-3

我正在使用以下api包装器:https://github.com/jmelosegui/GooglemapMvc

使用api创建带标签的标记是不可能的,所以我自己修改了javascript。

这很好(创建一个普通标记):

  var markerOptions = {
            position: new google.maps.LatLng(this.Latitude, this.Longitude),
            map: this.EnableMarkersClustering ? null : this.Map,
            title: this.Title,
            clickable: this.Clickable,
            draggable: this.Draggable,
        };


        // create marker
        this.GMarker = new Marker(markerOptions);

这不是(创建带标签的标记):

            // create marker
        this.GMarker = new MarkerWithLabel({
            position: new google.maps.LatLng(this.Latitude, this.Longitude),
            map: this.EnableMarkersClustering ? null : this.Map,
            title: this.Title,
            clickable: this.Clickable,
            draggable: this.Draggable,
            // Self added
            raiseOnDrag: true,
            labelContent: "A",
            labelStyle: { opacity: 0.75 },
            labelAnchor: new google.maps.Point(22, 0),
            labelClass: "labels", // the CSS class for the label
            labelInBackground: false,
            labelVisible: true,
            optimized: false,
            icon: {}
    });

        // Anything below here won't be reached!
        console.log("marker!");

为什么不到达console.log?

1 个答案:

答案 0 :(得分:1)

好的我认为你错过了markerwithlabel.js LINK

相关问题