【发布时间】:2019-06-12 20:31:47
【问题描述】:
我似乎找不到任何有关在 Google Maps API 中更新图标(标记)路径的文档。在这个特定示例中,我尝试将图标的 fillOpacity 从 0 更改为 1。
var myIcon = {
path: google.maps.SymbolPath.CIRCLE,
scale: 5,
fillColor: "#ff00ff",
fillOpacity: 0,
strokeColor: "#ff00ff",
strokeWeight: 2
};
var marker = new google.maps.Marker({
position: position,
icon: myIcon,
map: map,
title: 'My Marker>'
});
marker.addListener('click', function() {
this.setOptions({icon:{fillOpacity: 0.5}}); // Not working
this.setIcon({fillOpacity: 0.2}); // Not working either
});
【问题讨论】:
标签: google-maps-api-3 path icons