🤖 Merge PR #45996 [Leaflet] GeoJSON.resetStyle() can be called without an argument by @niconoe

This commit is contained in:
Nicolas Noé 2020-07-10 15:28:56 +02:00 committed by GitHub
parent 53e3fb2b8e
commit f04e299e27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -1290,7 +1290,7 @@ export class GeoJSON<P = any> extends FeatureGroup<P> {
* Resets the given vector layer's style to the original GeoJSON style,
* useful for resetting style after hover events.
*/
resetStyle(layer: Layer): Layer;
resetStyle(layer?: Layer): Layer;
/**
* Same as FeatureGroup's setStyle method, but style-functions are also

View File

@ -509,6 +509,9 @@ const styler: L.StyleFunction<MyProperties> = () => style;
geojson.setStyle(style);
geojson.setStyle(styler);
geojson.resetStyle();
geojson.resetStyle(layer);
class MyMarker extends L.Marker {
constructor() {
super([12, 13]);