2017-06-09 171 views
0

我想知道如何更改地圖標記圖標的大小。在完成在線教程後,我無法完成它!更改Google地圖標記圖標大小

var marker = new google.maps.Marker({ 
    position: new google.maps.LatLng(51.124110, -0.073897), 
    map: map, 
    title: 'Snazzy!', 
    icon: 'map_marker.png', 
    size: new google.maps.Size(20, 32) 
}); 

回答

1

對於那些你們誰是停留在類似的情況下,我知道了這個工作:

var image = { 
        url: 'map_marker.png', 
        scaledSize : new google.maps.Size(50, 50), 
       }; 

       // Let's also add a marker while we're at it 
       var marker = new google.maps.Marker({ 
        position: new google.maps.LatLng(51.524110, -0.073897), 
        map: map, 
        title: 'Snazzy!', 
        icon: image 
       });