这些代码使我感到困惑,我想为该变量添加一个图像,但是idk添加图像的代码是image:或图片:
var goldStar = {
path: 'M 125,5 155,90 245,90 175,145 200,230 125,180 50,230 75,145 5,90 95,90 z',
fillColor: 'yellow',
fillOpacity: 0.8,
scale: 1,
strokeColor: 'gold',
strokeWeight: 14
};
答案 0 :(得分:0)
要将图像添加为标记图标..您只需将路径分配给icon属性
假设您的图标(图片)存储在
var myIcon = 'https://maps.google.com/mapfiles/kml/shapes/parking_lot_maps.png';
var marker = new google.maps.Marker({
position: feature.position,
icon: myIcon,
map: map
});