更新时间:2023-11-22 09:34:22
您可以从标记本身获取旧图标,更改图标的大小,然后使用更改后的图标调用setIcon
:
You can get the old icon from the marker itself, change the size of the icon and then call setIcon
with the changed icon:
var icon = centerMarker.options.icon;
icon.options.iconSize = [newwidth, newheight];
centerMarker.setIcon(icon);