2017-03-13 7 views

答えて

1

をピクセル化されます小さな画像を置くとき、あなたのマーカーにオプションを与えることができます。

let marker; 

//example 
let icon = { 
    size: new google.maps.Size(46, 70), 
    origin: new google.maps.Point(0, 0), 
    anchor: new google.maps.Point(22, 70), 
    scaledSize: new google.maps.Size(46, 70), 
    icon: [URL] 
}; 

marker = new google.maps.Marker({ 
    map: this.map, 
    animation: google.maps.Animation.DROP, 
    position: new google.maps.LatLng(
    position.lat, 
    position.lng), 
    icon: icon 
    }); 
    marker.setMap(this.map); 
+0

私はtypescriptですし、非伝統的なJavaScriptを使用しています(注)、およびgoogle.maps.Pointとgoogle.maps.Size方法は、それはあなたが輸入Googleマップを必要とし、typescriptですだ –

+1

プラグインネイティブのGoogleマップでは使用できませんindex.htmlで@Componentの上にgoogleを宣言してください。 –

+0

それはたくさんの意味があります、私は(y) –

関連する問題