2014-11-24 36 views

回答

1

問題從optimized標記屬性,它MarkerWithLabel力量假莖。如果將optimized設置爲true(默認設置),則會導致正確的Spiderfying。這樣做需要一塊膏藥貼在MarkerWithLabel source雖然:去除設置optimized = false行:

function MarkerWithLabel(opt_options) { 
    opt_options = opt_options || {}; 
    opt_options.labelContent = opt_options.labelContent || ""; 
    opt_options.labelAnchor = opt_options.labelAnchor || new google.maps.Point(0, 0); 
    opt_options.labelClass = opt_options.labelClass || "markerLabels"; 
    opt_options.labelStyle = opt_options.labelStyle || {}; 
    opt_options.labelInBackground = opt_options.labelInBackground || false; 
    if (typeof opt_options.labelVisible === "undefined") { 
    opt_options.labelVisible = true; 
    } 
    if (typeof opt_options.raiseOnDrag === "undefined") { 
    opt_options.raiseOnDrag = true; 
    } 
    if (typeof opt_options.clickable === "undefined") { 
    opt_options.clickable = true; 
    } 
    if (typeof opt_options.draggable === "undefined") { 
    opt_options.draggable = false; 
    } 
    // if (typeof opt_options.optimized === "undefined") { 
    // opt_options.optimized = false; 
    // } 
    opt_options.crossImage = opt_options.crossImage || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png"; 
    opt_options.handCursor = opt_options.handCursor || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur"; 
    // opt_options.optimized = false; // Optimized rendering is not supported 

    this.label = new MarkerLabel_(this, opt_options.crossImage, opt_options.handCursor); // Bind the label to the marker 

    // Call the parent constructor. It calls Marker.setValues to initialize, so all 
    // the new parameters are conveniently saved and can be accessed with get/set. 
    // Marker.set triggers a property changed event (called "propertyname_changed") 
    // that the marker label listens for in order to react to state changes. 
    google.maps.Marker.apply(this, arguments); 
} 

enter image description here

+0

非常感謝..我有類似的問題,現在是工作的罰款.. – 2015-02-09 11:12:37