2015-11-07 37 views
0
var clusterStyles = [ 
     { 
      textColor: 'white', 
      url: 'http://example.com/image.png', 
      height: 40, 
      width: 40, 
      textSize: 14 
     }, 

我正在從一個url中獲取圖標圖像,並試圖通過調整高度和寬度來調整大小,現在圖像圖標剛剛變爲另一半的一半。如何在不切斷部分圖像的情況下縮小尺寸?我如何減少谷歌地圖中的集羣圖標的大小?

+0

您可以發佈小提琴例子 –

回答

0

嘗試爲標記集羣的樣式參數 集樣式選項(這些是默認樣式)

mOptions = {styles: [{ 
height: 53, 
url: "pic_link", 
width: 53 
}, 
{ 
height: 40, 
url: "pic_link", 
width: 46 
}]}; 

和調用構造函數

var clust= new MarkerClusterer(map, markers, mOptions);