更改谷歌地图中的标记大小

时间:2013-08-16 00:30:48

标签: javascript google-maps google-maps-api-3

我正在尝试更改标记尺寸,无论我如何尝试它们都会消失。我试过这个:

scaledSize: new google.maps.Size(100, 68)

var marker;
addressDetails = stringArray[x].split("&&&");
var lat = new google.maps.LatLng(addressDetails[1], addressDetails[2]);
//Create a new marker and info window
marker = new google.maps.Marker({
    map: map,
    position: lat,
    icon: 'http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=A|000000|FFF',
    content: addressDetails[0]
});
markersArray.push(marker);

1 个答案:

答案 0 :(得分:4)

使用https://developers.google.com/maps/documentation/javascript/overlays#Markers以供将来参考

new google.maps.Size(42,68)

42和86是像素值。那些会将标记缩放到你想要的任何东西。

来源: Change marker size in Google maps V3

相关问题