change size of marker in leaflet
问题 I have one marker on the map in leaflet: var centerMarker = L.marker(centerPoint, { title: 'unselected' }).bindLabel(schools[i][0]); centerMarker.on('click', selectMarker); centerMarker.addTo(map); I want to change the size of that marker on click. I know that we can change icons but I just want to change the size of the same icon of the marker. 回答1: 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 =